'How to get streaming subscription failure EWS

I want to reproduce a bug, these are the conditions :

  1. GetStreamingEvents request should fail and preferably get 500 error from office365/exchange
  2. The Resync request to send GetStreamingEvents periodically should keep failing.

Here is what I have tried so far :

  1. I have tried to remove X-AnchorMailbox header and not send any Impersonation header but my syncing still works and GetStreamingEvents is a success.
  2. On Exchange I moved users from one Database to another and Streaming events failed for a while till migration was in progress but it succeeded eventually.
  3. Tried disabling Admin mailbox on exchange but that too didn't lead to any error.
  4. Of course I tried to hardcode exchange's response but this hack is not 100% reliable.

I have Exchange2019 (acting as office365). I just want to lose my subscriptions somehow through Streaming notification mechanism of EWS. Please help me in this - what can I tweak on exchange or in my request to get streaming event failure.



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source