[zeromq-dev] Question about multiple Pub/Sub sockets

gonzalo diethelm gdiethelm at dcv.cl
Sun Mar 7 04:05:24 CET 2010

I apologize in advance for the soup letter. Please bear with me for just
three short paragraphs.

Say I have one process A, from which I wish to notify about certain
events by using Pub/Sub sockets, so that I can decouple the notifier
from the receivers of those notifications. A would generate events E, F
and G.

On the receiver side, say I have processes P and Q; P is interested in
events E and F, Q is interested in events F and G. I could have process
A open three Pub sockets, for events E, F and G; then from P I would
open Sub sockets E and F, and from Q I would open Sub sockets F and G.
Presto! A can just go ahead and send out notifications, without worrying
if there are 1, 2 or 10 processes listening to them.

Now, let's say I want to add a new process B, which generates events F,
G and H. So for the case of event F, I now have two processes (A and B)
generating the same event, and two processes (P and Q) interested in
that event. How would I do this? Although P and Q can open the same Sub
socket for event F, I don't think it would be possible for both A and B
to open the same Pub socket for that event. Or am I wrong?

The only way I can think of implementing this pattern would be to have
one intermediate process N which acts as the central notifier. A and B
send all events to N (using Downstream sockets), which is now the ONLY
process opening Pub sockets and sending out notifications. This would
work, and it may even be "right"; the only concern would be that I now
centralize all notifications in a single point of failure.

I would appreciate your thoughts on this pattern, even to be told I am
totally wrong about it. Thanks in advance.

Gonzalo Diethelm 

Declaración de confidencialidad: Este Mensaje esta destinado para
el uso de la o las personas o entidades a quien ha sido dirigido y
puede contener información reservada y confidencial que no puede
ser divulgada, difundida, ni aprovechada en forma alguna. El uso no
autorizado de la información contenida en este correo podrá ser
sancionado de conformidad con la ley chilena. 
Si usted ha recibido este correo electrónico por error, le pedimos
eliminarlo junto con los archivos adjuntos y avisar inmediatamente
al remitente, respondiendo este mensaje. 

"Before printing this e-mail think if is really necesary".
Disclosure: This Message is to be used by the individual,
individuals or entities that it is addressed to and may include
private and confidential information that may not be disclosed,
made public nor used in any way at all. Unauthorized use of the
information in this electronic mail message may be subject to the
penalties set forth by Chilean law. 
If you have received this electronic mail message in error, we ask
you to destroy the message and its attached file(s) and to
immediately notify the sender by answering this message. 

More information about the zeromq-dev mailing list