I am writing an integration piece that basically listens for items on a queue and pushes data into SalesForce.

Currently for every message I login, perform the import, and logout.

Is this going to get me rate limited? Because messages can be processed at the same time am I ok to share a login session?

I know sessions last for up to 2 hours (currently) so should I share the session where I can, and just re-authenticate ever 2 hours?


Ok, I think I have figured it out. The login page says the following:

Multiple client applications can log in using the same username argument. However, this increases your risk of getting errors due to query limits. A user can have up to 10 query cursors open at a time. If 10 QueryLocator cursors are open when a client application, logged in as the same user, attempts to open a new one, then the oldest of the 10 cursors is released. If the client application attempts to open the released query cursor, an error results.


There is a limit of 3600 calls to login() per user per hour. Exceeding this limit will result in a “Login Rate Exceeded” error.

So I think I need to ensure I re-use logins where I can.

| improve this answer | |
  • The first point applies across all sessions, so there's little incentive to multitask with a single user account (e.g. multiple integration apps and/or multi-threaded apps). But you definitely want to avoid logging in any more frequently than necessary (mind you, 3600/hour is one per second, so you're not likely going to break that limit). Also, as an aside, the session times out after the given limit. If you're actively using your session at least once every two hours, it will roll indefinitely until explicitly logging out/timing out. – sfdcfox Nov 18 '15 at 0:01

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.