[zeromq-dev] (no subject)

Martin Sustrik sustrik at 250bpm.com
Thu Apr 8 06:44:31 CEST 2010


Laurens,

> I've got a use case and I'm wondering how it translates to ZeroMQ.
> 
> Data comes in through a server that reads a client's SSL certificate 
> (not very relevant, unless ZeroMQ can do SSL, verify a certificate, and 
> then route based on the client cert). All of that data gets persisted, 
> so there are servers that do nothing but persist data. Some of the data 
> is also pushed to people monitoring it live (think Comet/Websocket).
> 
> The problem is that there are two separate things:
>    - persistence servers, between which load balancing must be done
>    - the server side push server
> 
> So basically there's a group for which exactly one must be pushed to 
> (load balancing behavior), and a group for which all must be pushed to. 
> The obvious solution is two exchanges, but I think this means sending 
> the message to the ZMQ server twice, which sounds far from optimal.

0MQ sockets translate to "business logic feeds". It doesn't allow you 
two mix several logically disparate functionalities within a single 
socket. In your scenario you have two different business logic feeds:

1. persisting
2. notifying interested parties

Thus, you have to open two sockets and send the message to both of them.

The rationale is that - for instance - you may wish notification message 
oto contain only on subset of properties when compared to persistence 
message. Or you may have different reliability requirements etc.

Martin




More information about the zeromq-dev mailing list