function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
tssupporttssupport 

Rate limiting with the SOAP Api

How can I test the rate limiting features with the SOAP Api? In order to correctly handle this exception I need some examples of a rate limiting response.

Regards
tssupport
Ki Consulting

DevAngelDevAngel

The rate limiting for Developer Edition has been throttled back to 10% of the limit for a production instance of salesforce.com.  This is to allow you to verify and test your rate limiting handlers. 

The reduced threshold will be available as of the next scheduled release of salesforce.com due early July.

Due to the restricted nature of DE (Developer Edition) you will have a difficult time putting enough data into the application to be able to trigger a rate limit fault.  You can certainly give it a go and try.

FYI, salesforce.com does about three releases a year to introduce new features to it's product.  Developer edition is one of those products, so is on the same release schedule.  These updates will also include new API functionality.  Any new API functionality will be prominently announced on www.sforce.com

Message Edited by DevAngel on 06-06-2003 08:37 AM

Message Edited by DevAngel on 06-06-2003 12:01 PM

tssupporttssupport

How can a rate limit fault look like? As I understand it, the fault will not throw an exception. What tags should I search for in the response?

DevAngelDevAngel

Rate limiting is manifested with a standard fault code.  The following is an excerpt from the documentation:

All clients are required to use rate limiting. Clients are metered according to the server resources they consume which is measured by the amount of time each call takes. Clients that exceed their instantaneous allowed resources are rate-limited for a period of time. Clients that have been rate-limited receive fault code 1010 until the rate limit period has expired. The fault message that accompanies fault code 1010 always starts with an integer, followed by �ms delay:�. The integer is the number of milliseconds that the client must wait before the rate limit period expires. Clients should normally wait for the indicated period of time and then retry the request.

...

Simulating Rate Limit Conditions

The sforce API provides developers with a tool to simulate rate limit conditions as part of validity testing. API users can send the HTTP Header �RateLimitAdd� to simulate that a particular call took additional time to complete. The RateLimitAdd header must specify the number of additional milliseconds to add to the simulated length of the call, beyond the amount of time the call actually takes.

For example to simulate that a call took 80 seconds longer, you can send the HTTP header as follows:

   RateLimitAdd: 80000

Because rate limits are calculated based on how long each call takes, the RateLimitAdd header can be an effective way to simulate rate limits.

 

Hope this helps.