Note that there are some explanatory texts on larger screens.

plurals
  1. POImplement durable pub/sub?
    text
    copied!<p>Let's say I have a publisher and mutiple listeners. When the publisher sends a message, it has to be received by all listeners. If one of the listeners is down, he should get the message as soon he is back up again.</p> <p>How can I implement this?</p> <p>I was thinking about using queues: Each listener makes it's own queue and sends a subscrtiption message to the publisher with the location of it's queue. The publisher saves the location to a file or DB, and starts sending it's messages to that queue.</p> <p>So, this would be the timeline:</p> <p>Publisher is started. No listeners yet.</p> <p>Publisher sends message 1.</p> <p>Publisher sends message 2.</p> <p>Publisher sends message 3.</p> <p>Listener 1 starts and subscribes with publisher.</p> <p>Publisher sends message 4.</p> <p>Listener 1 receives message 4.</p> <p>Listener 2 starts and subscribes with publisher.</p> <p>Publisher sends message 5.</p> <p>Listener 1 receives message 5.</p> <p>Listener 2 receives message 5.</p> <p>Listener 2 chrashes.</p> <p>Publisher sends message 6.</p> <p>Listener 1 receives message 6.</p> <p>Publisher sends message 7.</p> <p>Listener 1 receives message 7.</p> <p>Listener 2 comes back up, no need to subscribe again.</p> <p>Listener 2 receives message 6.</p> <p>Listener 2 receives message 7.</p> <p>The bottom line is I need one queue per listener, and one queue or channel to send and receive messages for 'start listening' and 'stop listening'. Am I thinking in the right direction, or am I completely wrong?</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload