2

I am using Java EWS API in my web application to connect my application to MS Exchange and read user email requests. Also I am using a scheduler to pull subscription every 1 minute.

Problem is when I start my application, EWS-API works fine. It gets all new mails and processes it. But after few days, whenever the scheduler tries to pull the subscription inbox, the application throws the following error :

microsoft.exchange.webservices.data.ServiceResponseException: The specified subscription was not found.

Maybe it is thread issue or memory issue, I am not sure. Please suggest any reason for this issue.

JasonMArcher
  • 14,195
  • 22
  • 56
  • 52

2 Answers2

0

Have a look at this article, the Client Access Server affinity issue it describes maybe what you are encountering.

http://blogs.msdn.com/b/exchangedev/archive/2011/07/20/client-access-server-affinity-and-network-load-balancing-considerations-for-programmatic-access-to-exchange-online.aspx

Supposedly if you use the EWS Java version 1.1 library (or later) you shouldn't get this particular issue however.

So I'd try checking your EWS library version, and if you still get the problem, add retry logic into your app to recreate the subscription when you encounter this error.

donovan
  • 1,442
  • 9
  • 18
  • You should try out the latest version of the library that is now available on github: https://github.com/OfficeDev/ews-java-api/ -- contributions are welcome. – vboctor Sep 22 '14 at 01:12
0

I have been using EWS Push subscription since 2017 so not sure if below might help or not but if you can share your code I can check and see if I can found something.

For Push Subscription I have seen many different errors and to avoid any issues I am using an Object Pool of connection and if I encounter any random error from Exchange Server, I discard current connection and create a new one which mostly solve these kind of issues.

Also you can try setting anchor mailbox while establishing connection it helps with some of the issues.

Also if you can share some sample code I am happy to check.

DhruvG
  • 394
  • 1
  • 2
  • 10