1

Now I have subscribed a push notification to EWS to receive Create or New mail events, but sometime I can’t get heartbeat event from EWS more than one hour.

So, if I want to check whether these push notification subscriptions succeed, is there any tool to check it directly?

Thanks in advance!

Vincent
  • 11
  • 1
  • 2

1 Answers1

3

No, there is no way of enumerating the current Push subscriptions on a Mailbox, if you successfully subscribed to a Push notification then you would have got a response with the SubscriptionId and status success. To keep a push notification active you need to respond to the heart beat messages which will contain the SubscriptionId (you get at the time of subscription) which are sent every minute see https://blogs.msdn.microsoft.com/webdav_101/2014/04/17/ews-push-what-is-the-statusfrequency-for/ for details on the status frequency . If you have access to the server then server will log errors if it can't successfully send a push notification

Typically with Push notifications the issues are with the server communicating to your listener is that end point isn't reliable or accessible from the server. But the server Subscription can go away without notice if there is a Server issue, so your code needs to track the lack of status update from the server as a sign there maybe problems with the subscription there's a good sample https://blogs.msdn.microsoft.com/emeamsgdev/2011/08/19/ews-push-notification-example-application/ .

Streaming subscriptions can be a better fit for push notification application from a client application persepctive because the client connectivity is a lot more flexible, you can also easily check if a SubscriptionId is still available using a GetEvents request etc. Although if your using Office365 the new Webhooks in the REST API are a much better overall approach.

Cheers Glen

Krzysztof Wolny
  • 10,576
  • 4
  • 34
  • 46
Glen Scales
  • 20,495
  • 1
  • 20
  • 23
  • Really appreciate for your help! – Vincent Mar 28 '16 at 02:46
  • 1
    Heart-beat messages are not sent every minute, they are sent with more-less StatusFrequency, at least in my case, for O365... The main issue is that they often fail to heart-beat so you need to monitor it using some timer mechanism and there is no way to ask about subscription status. – Krzysztof Wolny Jul 29 '16 at 11:12