I have a message that is on queue, but, when the message is successfully trigged, I don't want to delete the message from queue. I want to keep the message there, to be retriggered at another time, does anybody have an idea of how configure rabbitMQ for that?
2 Answers
You can't do that, but you can add a second queue to the exchange and route the message to both. You can then consume from the second later on.
Or, of course, your consuming application can re-publish to the same or another queue.

- 166,535
- 14
- 146
- 179
-
Exactly, +1. Additionally (without searching) there may be some extensions that may offer another solution, I mean for this 'at another time' part (I always get surprised to all the extensions there are for rmq) but re-publishing seems what would suit you best. – cantSleepNow Aug 30 '16 at 06:36
What you can do is there is a concept foe dead letter queue. After the message has been read successfully you can move that message to dead letter queue.
That's the only way you can have the message taken care of at sometimes later. Or if you want to keep the message in the same queue then you can do something like done Ack the message and let it be there but that way you might end up blocking the queue.
So using dead letter queue solves the problem, but usually the purpose of dead letter queue is to move the message to it when they are stuck in the queue.

- 717
- 4
- 8