We use the Exchange Web Services API (EWS) for Office 365 to create calendar events in the user's calendar. This works great for on-premises deployments, but with the deployment of Office 365 we seem to pretty quickly achieve throttling limits.
After creating 16 events in the calendar of 16 different users (from the service account, using delegate access to calendars), we get the following error:
ErrorTooManyObjectsOpened - Too many concurrent connections open
After ~ 5 minutes, this error is cleared, and we can continue to create events. It seems that the EWS server caches connections to mailboxes, and Office 365 seems to allow you to connect to 16 mailboxes at the same time.
We tried a lot to overcome this error, but did not find a “final” solution or workaround. What we tried:
- Using impersonation instead of delegation: this works, but this is not a security solution.
- Using multiple service accounts: this works, although each account is still limited to ~ 16 users in 5 minutes.
- We tried the
X-AnchorMailboxand headers X-PreferServerAffinity, and we make requests with and without HTTP, storing them, and storing HTTP cookies and without it. It does not matter. From the debugging information, we see that we usually end up on the same front-end and back-end server if we store cookies / connection, and that we end up on a different front-end if we delete cookies but send X-AnchorMailbox. - API REST, .
CreateItems, , , FindItems .
- , , - , , Office 365? Office 365 , , ?
: EWS Java API, , .