How to enqueue old messages into a new queue in RabbitMQ Exchange?

I have an exchange with a type of topic that only redirects messages to queue payments

Somewhere in the future, I will decide to add another queue payment_analyze to analyze all old and new messages that have been enqueued.

durable exchanges and queues survive rabbit MQ restarts, persistent messages get written to disk but when binding a new queue to an old durable exchange, old messages do not get redirected (only new ones do get redirected)

From my understanding, this is the intended behavior as exchanges do not store messages and only act as a “proxy”

How do I achieve this?

Possible Solution

Creating a queue named parking and adding every enqueued message to it, whenever a new queue is added, consume messages from parking without acknowledging to keep the new queue “semi” up to date.

Read more here: Source link