[zeromq-dev] Help with pattern design

Alex Massover alex at jajah.com
Thu Aug 2 17:34:48 CEST 2012


Hello,

I'm trying to design a pattern that will fit my application but can't find a proper solution. I'd appreciate if someone could enlighten me.

I have a process that deals with sessions (voip calls). This server produce events for every session, e.g.:
Session1: start
Session1: msgA
Session1: msgB
Session1: msgC
...
Session1: msgX
Session1: stop

Each event has a session id. Many sessions exist concurrently.

And there're multiple workers that consume these events. Single event should go to single worker. (PUSH/PULL like pattern).

My initial though was single PUSH (server that produce events) and multiple PULL (workers that consume).

My challenge is avoid race condition in processing events, i.e. workers supposed to consume events in the same order as they produced. And this should be done in realtime, I can't serialize at worker side. And single worker is not enough from performance point of view.

Is there any ZMQ magic (pattern) that can force all events from single session (based on session id?) to be sent to same worker? This way I'll ensure that worker process events in the same order they appeared.

--
Best Regards,
Alex Massover

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.zeromq.org/pipermail/zeromq-dev/attachments/20120802/19c9eb3c/attachment.htm>


More information about the zeromq-dev mailing list