I'm looking for a way to block message delivery for a moment and reactivate it without loosing the messages.
The case is when we need to migrate consumers, I don't want messsages to be delivered for like 10 minutes. I want to block queue delivery and then reactivate it.
Is there a way to do this? In Python or in PHP?
EDIT:
With this process I don't want to get consumers disconnected. I want it like putting the queue on hold, no message delivered to current consumers and then "reactivate it".
Though you already might have solved the problem:
You could use 2 Queues instead of one.
produce -> Q1 -> Direct Exchange -> Q2 -> consume
Then you can dynamically delete the binding (API call "unbind") between the Exchange and the Q2. Then Q2 drains empty and Msg queue in Q1 until you bind it again after your maintenance.
I wish there was something like "Pause Queue for x-Minutes" to implement a simple retry mechanism.
Block Queue delivery on RabbitMQ