I am taking messages from ActiveMQ queue and running a Java application which can succeed or fail.
In case the application fails, i want the message to remain on the queue, that is to keep it without dequeueing it.
Is there a way to take a message with out automaticly erasing it from the queue?
Is there are atom operation like fetching from queue or erasing from queue?
Thanks.
Disable auto-acknowledge of messages, and then call message.acknowledge() manually after the work is done. If an exception is thrown and thus the message.acknowlege() is not called, AMQ will attempt to deliver the message again. If all attempts fail, the message is finally placed in the dead letter queue. This behavior can be configured.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With