[zeromq-dev] Using ØMQ just as in-memory queue

Martin Sustrik sustrik at 250bpm.com
Sun Sep 11 09:13:26 CEST 2011


Hi Anatoly,

>        1. Is that a good idea to do so? To use ØMQ just as an in memory
> queue ( rather than a Queue data structures in various languages ).

Yes. I believe so.

>        2. In case the answer to the question above is YES... We have
> several different message types ( let's call these types 'A' , 'B', 'C'
> .. 'Z' ). In case I use subscribers to these different types [ e.g.
> subscriber.subscribe ( "A" ), subscriber.subscribe ( "B" ), etc.. ], is
> there a way to ensure that all the messages will be processed in order?
> In other words, if messages were sent as 'A', 'B', 'C', and we have 3
> subscribers, is there a way to guarantee that when a subscriber 'C' gets
> the message, messages 'A' and 'B' were already processed? In that case I
> can rely on ØMQ to play a role of a queue as well as a
> router/dispatcher, which would be helpful.

To achieve that kind of behaviour you would have to synchronise the 
subscribers.

If you opt to do so, it's not clear why not to do all the work in a 
single thread in the first place.

Martin



More information about the zeromq-dev mailing list