Reputation: 363
I would like consummers to subscribe to events, in case one of them die, I'd like the messages to be persisted for this consummer, so it gets them once it is online. If the producer creates N queues, 1 per consummer, then it works. But the producer shall not not take care of whether there are consummers or not, and how many they are. The consummer shall have the responsibility to create its own queue, select the messages it wants to receive, and the queue shall persist. Can you please give me a direction?
Does it require anything specific on the producer side?
The tutorials on RabbitMQ website only talk about persistence in a way that if the server die, then messages are persisted, or another exemple with one queue, N consummers, there is persistency if all consummers are dead only (becasue the message was not delivered), but this is a senario where the message is delivered to only one of the consummer (randomly), while I need ALL consummers to receive the messages they subscribed to, and persistency per consummer.
thanks, Rod
Upvotes: 0
Views: 58
Reputation: 17168
Use a topic exchange and have each consumer create it's own unique persistent queue and bind it to the exchange with a topic to which you want to subscribe. Publishing a message on the exchange will deliver that message to each queue bound to that exchange/topic. If one of your consumers dies, its queue will continue to queue messages it receives from the topic exchange.
Upvotes: 1