Consistent View of an email folder (streaming vs pulling or both) RRS feed

  • Question

  • Hello again.

    I am trying to figure out a good way to make sure that I have an accurate representation of a folder locally.

    I have two tools at my disposal.

    Pulling Subscription and StreamingSubscription.

    If I do a pull every 1 minute - I am fine as it catches everything since the last time I did a pull. The downside is that 1 minute is not always acceptable latency.

    If I rely on Streaming Subscription - when it works it is great. But if my internet connection is not reliable, I am afraid I may loose updates. There are a few scenarios where both sides "think" the connection is fine but that may not be the case. If there is a disconnect for say 5 minutes, in which the server sent the notifications to the client, then the connection timed out at the client side. The client can open the subscription again, even with the same subscription id, but the updates that the server "thinks" were sent, are lost.

    What does it leave me with. I was thinking of a hybrid approach.

    1) have a pulling subscription which is called every 5 minutes (or less)

    2) have a streaming subscription. Because when I finally get an update, I cannot be sure that it contains all the notifications, so to be on the safe side, wake up the thread that was waiting for the next pull in the 5 minute window and have it do a pull. Do the same when the client side the detect a disconnect or a expiration of the streaming subscription.

    The down side of that approach is that on every streaming event, the notifications in hand are ignored, and a full pull is initiated.

    On the other hand, I don't see a way to ensure that the data in a streaming notification is complete. 

    Any thoughts?



    • Edited by Erez Katz Wednesday, March 11, 2015 11:51 AM
    Wednesday, March 11, 2015 11:51 AM

All replies

  • Have you considered using sync? Use the notification to trigger a sync. That should ensure you don't lose any changes since sync is based off of your sync state.
    Wednesday, March 11, 2015 4:19 PM
  • Jason, thank you for the reply.

    I thought of sync but I did not see a way to do a sync from a given point in time, say, the last 60 days or 1000 emails "ago" or  the last time I did a full rebuild of my copy of the folder, that consists of the last N items.

    Some folders can have over 200K items, and I want to avoid doing an "initial" sync and then 1000's of subsequent calls just to get it into a recent point of time... am I missing something ?



    Thursday, March 12, 2015 8:40 AM
  • Let me rephrase my question.

    Is it possible to "fast forward" a sync connection to a recent time stamp (say 1 month) for cases where a folder may contain 100's of thousands of emails?

    Monday, March 16, 2015 10:04 AM
  • Not directly. You'd need to do an initial "throw-away" sync to get up to date, then manually process the items back to your cut-off date, then use sync going forward to catch updates. See https://msdn.microsoft.com/EN-US/library/office/dn440952(v=exchg.150).aspx#bk_filteredsync
    Monday, March 16, 2015 3:17 PM