1

I'm trying to get my head around to the behaviour of zmq with PUB/SUB.

Q1: I can't find a real reason why with the PUSH/PULL sockets combo I can create a queue that actually queue in memory messages that it can't get delivered (the consumer is not available) when with the PUB/SUB not.

Q2: Is there any technical whitepaper or document that describes in detail the internals of the sockets?

EDIT: This example of PUSH/PULL streamer works as expected (the worker join late or restart and gets the queued messages in the feeder. PUB/SUB forwarder does not behave in the same way.

user3666197
  • 1
  • 6
  • 50
  • 92
0x41ndrea
  • 385
  • 5
  • 23

1 Answers1

-1

While Q1 is hard to be answered / fully addressed without a SLOC ...

there is still a chance your code ( though yet unpublished,
which StackOverflow so much encourages user to include in a form aka MCVE
and you may already have felt or soon might feel some flames for not doing so )

just
forgotten
to set a subscription topic-filter

aSubSOCKET.setsockopt( zmq.SUBSCRIBE = "" )          # ->recv "EVERYTHING" / NO-TOPIC-FILTER
aSubSOCKET.setsockopt( zmq.SUBSCRIBE = "GOOD-NEWS" ) # ->recv "GOOD-NEWS" MESSAGES to be received only

A2: yes, there are exhaustive descriptions of all ZeroMQ API calls +

besides the API manpage collection for ØMQ/2.1.1 and other versions,
there is a great online published pdf book "Code Connected, Vol.1" from Pieter HINTJENS himself.

Worth reading. A lot of insights into general distributed-processing area and ZeroMQ way.

user3666197
  • 1
  • 6
  • 50
  • 92
  • Thank you. I'm going to read that document. I've updated the question with the links of the two architectures I've tried. – 0x41ndrea Apr 30 '16 at 07:52
  • Glad the answer helped. If your MCVE-related trouble continues, rather post the MCVE that demonstrates the failure in a fully repeatable manner. Details what is the internal ZeroMQ PUB/SUB behaviour is well documented in relevant section **[ Publish-subscribe pattern ]** of **http://api.zeromq.org/2-1:zmq-socket** – user3666197 Apr 30 '16 at 10:24