This two images are from http://zguide.zeromq.org/page:all.
What is the difference between this two pattern if we ignore sink in push-pull pattern ? Is there a difference in how a message gets transfer, if yes what is the difference ?
The difference is that a PUB
socket sends the same message to all subscribers, whereas PUSH
does a round-robin amongst all its connected PULL
sockets.
In your example, if you send just a single message from the root, then all the subscribers will receive it (barring slow subscribers, etc.) but only 1 worker.
The pub/sub pattern is used for wide message distribution according to topics. The push/pull pattern is really a pipelining mechanism. Your push/pull example seems to be attempting to do load-balancing, which is fine, but req/rep might be better suited to that due to other issues.
It looks like the "issues" here are described in the same part of the 0MQ guide you got the image from : push/pull ventilator example
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With