Question

with zeromq, after sender sends 10 messages, then sender crashed.

scenario 1: the receiver is processing the messages one by one with some noticeable time cost, will it still get the 10 messages in this scenario?

scenario 2: another scenario is when receiver crashes, after receiver is recovered, can it continue to receive what it missed during its blackout?

scenario 3: if the receiver crashed with pending messages in the queue, another receiver starts to listen to the queue, can it get what's left in the queue?

Was it helpful?

Solution

scenario 1: the receiver is processing the messages one by one with some noticeable time cost, will it still get the 10 messages in this scenario?

If the sender got all of its messages out then they will be sitting in the receivers queue. Assuming you've set the High Watermark options high enough for the receiver then it should process them all.

scenario 2: another scenario is when receiver crashes, after receiver is recovered, can it continue to receive what it missed during its blackout?

Assuming the sender has not crashed as well: The sender will still have the messages queued in its out-going queue for that receiver. As long as the number of messages queued don't exceed the high watermark options set on the sender, the receiver will receive al lthe pending messages when it reconnects.

scenario 3: if the receiver crashed with pending messages in the queue, another receiver starts to listen to the queue, can it get what's left in the queue?

ZeroMQ keeps a queue per peer. So that queue would be lost. This is assuming you're using the simple peer to peer methodology. If you're using PUBLISHER->SUBSCRIBER then multiple receivers can share the same queue.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top