locked
OnSubscriptionError : Microsoft.Exchange.WebServices.Data.ServiceResponseException: Unable to retrieve events for this subscription. The subscription must be recreated., The events couldn't be read. RRS feed

  • Question

  • Using C# .NET 4.6.1 with Microsoft.Exchange.WebServices nuget package 2.2.0 connecting to Office 365.

    Expected disconnection is set to every 3 minutes.

    Error is handled as below:

    1. The OnSubscriptionError event fires with a ServiceResponseException.
    "Unable to retrieve events for this subscription.  The subscription must be recreated., The events couldn't be read."

    2. I recreate/renew the subscription as suggested by the error.

    3. I then receive one notification but no more.

    4. I have to restart the C# program/service in order to get StreamingSubscriptions working again.

    What is the best practice for recreating/renewing the subscription?

    Do you know of any other possible causes? - Microsoft themselves have been mainly focused on tweaking the throttling.

    Thanks.


    Monday, December 11, 2017 2:17 PM

All replies

  • As a starting point I would suggest you use the latest version of the EWS Managed API from Github https://github.com/OfficeDev/ews-managed-api there are number of issues https://github.com/OfficeDev/ews-managed-api/issues that have been fixed around subscriptions that could be causing your code to fail. 

    Other then that the error are probably because you code isn't robust enough maybe if you test with https://ewsstreaming.codeplex.com/ instead even do a side by side test etc.

    Cheers
    Glen

    Tuesday, December 12, 2017 12:42 AM