Search code examples
c#zeromqnetmq

NetMQ Pub Sub Most Recent


In your typical pub sub pattern there are clients who subscribe to servers who publish events. In my application, the publisher continuously publishes events that comes asynchronously. In my clients, they lag sometimes in processing those events. My question is whether there is a work around whereby the client always takes the most recent event sent out by the publisher as oppose to having to process all the received events sequentially.


Solution

  • Take a look at the slow subscribers pattern from the zeromq guide:

    http://zguide.zeromq.org/page:all#toc117

    Also you can develop your own pubsub over NetMQ using dealer-router and implement your publishing strategy. I would suggest you use credit based flow control if you do that.

    http://hintjens.com/blog:15