[zeromq-dev] Question about Strange Socket Pairing

Justin Karneges justin at affinix.com
Wed Dec 5 01:46:43 CET 2012


Writes to PUB never block. If a subscriber's queue is full, then the message 
is dropped for that subscriber. If there are no subscribers, the message is 
dropped entirely.

Connect vs bind is a matter of which entity should be considered to have 
stable availability. For example, if a single publisher serves data to an 
arbitrary number of subscribers (maybe some notifications system), then you'd 
bind with PUB and connect with SUB. On the other hand, if an arbitrary number 
of publishers send data to a single subscriber (maybe some stats collection 
system), then you'd bind with SUB and connect with PUB.

On Tuesday, December 04, 2012 04:35:54 PM Matt Goodman wrote:
> Mmkay.  That is what I was feeling.  So a followup question would then be
> what it the correct way to go about this?  The push/pull socket thing works
> well, I am just concerned about the HWM semantics of blocking.
> 
> I would much rather use a Pub/Sub connection model, but I would need
> multiple publishers with a single subscriber?  This seems a bit backward.
>  I think the XPub/XSub model has what I need, but I am unclear on the
> semantics of which calls bind and which connects . . .
> 
> 
> 
> --Matthew Goodman
> 
> =====================
> Check Out My Website: http://craneium.net
> Find me on LinkedIn: http://tinyurl.com/d6wlch
> 
> 
> 
> On Tue, Dec 4, 2012 at 3:41 PM, Michel Pelletier <pelletier.michel at gmail.com
> > wrote:
> > 
> > The guide says:
> > 
> > "Any other combination will produce undocumented and unreliable results
> > and future versions of ØMQ will probably return errors if you try them."
> > 
> > So, looks like you got lucky.  You can't rely on that however and in the
> > future it likely will break as the underlying protocol evolves to guard
> > against these cases.
> > 
> > -Michel
> > 
> > On Tue, Dec 4, 2012 at 3:36 PM, Matt Goodman <meawoppl at gmail.com> wrote:
> >> I am writing an application that uses ZMQ for a couple of different
> >> things, one of which is error logging.
> >> 
> >> For reasons that somewhat complicated, the logging server is written in
> >> Node, and the "clients" are Python and C++.
> >> 
> >> I had no trouble getting everything to commuicate, and send messages with
> >> relative ease, however I wanted to ask a question about a strange socket
> >> pairing that I found to work, when I didn't expect it to.
> >> 
> >> Initially, my logging was done with a node "PULL" socket, and several
> >> other "PUSH" clients.  I wanted to eliminate the blocking behavior.  I
> >> started the transition to the PUB/SUB model, but when I had retooled 1/2
> >> of
> >> my code, the tests I had passed.
> >> 
> >> Specifically, I had a PUB socket talking to a PULL socket . . .
> >> successfully. . .
> >> 
> >> Is this pairing allowed, and are there unintentional oddities I will run
> >> into with it?
> >> 
> >> Oh.  Great project/product, and good work!  Thanks!
> >> --Matthew Goodman
> >> 
> >> =====================
> >> Check Out My Website: http://craneium.net
> >> Find me on LinkedIn: http://tinyurl.com/d6wlch
> >> 
> >> 
> >> _______________________________________________
> >> zeromq-dev mailing list
> >> zeromq-dev at lists.zeromq.org
> >> http://lists.zeromq.org/mailman/listinfo/zeromq-dev
> > 
> > _______________________________________________
> > zeromq-dev mailing list
> > zeromq-dev at lists.zeromq.org
> > http://lists.zeromq.org/mailman/listinfo/zeromq-dev



More information about the zeromq-dev mailing list