I see that it maintains a _lastProcessed Position, but doesn’t seem to store it permanently anywhere. I would think this would be a necessity if the dispatcher dies, etc. What would be the best way to do this? Write to a file? I honestly haven’t used flat file storage for real-time persistence, so am wondering what caveats if any I am missing in terms of best performance/safest way to store _lastProcessed.
Also, this post is from last July, so if there are better solutions, I’d love to hear about them.
I think the only really important thing is that it’s stored durable, since otherwise you could process messages twice. I successfully used Azure Blob Storage and Redis (not that durable ) … it’s mostly decided by the performance you need and the resources you have at hand or want to establish in your infrastructure.
Brian
I worked on that code quite some time ago with James and Andrii’s help. They helped me a lot, but the CatchupSubscription that Greg mentioned is the way to go. That code in the Gist isn’t battle tested. I was very appreciative of Andrii and James’s help as it got me up and running with a prototype I was working on at the time, but there are now better alternatives.