Reputation: 9309
I looked at ZMQ PUSH/PULL sockets and even though I quite like the simplicity (especially compared to custom fragmentation/ack I am implementing right now in a system over UDP sockets), I would like to have custom load balancing instead of the naive round-robin (I believe) that ZMQ PUSH/PULL sockets are using.
I am new to ZQM and not sure how I can implement it using ZMQ sockets and if it's even possible at all. What I would ideally like is, the serving PUSH socket (or some other socket type) determines (based on the messages etc.) which machine to send the message to.
So my questions are:
Upvotes: 2
Views: 2344
Reputation: 38588
If you want to have custom routing, you have to use ROUTER sockets, and then use IDENTITY-based routing. There is an example in the Guide illustrating how to build simple LRU routing with a ROUTER socket (i.e. behaves the same as PUSH). You would just need to write your own logic for deciding which worker IDENTITY gets each message.
Upvotes: 3