OpenJMS redelivers and delays messages

86 views Asked by At

I have a consumer of a JMS queue. An exception may occur during the consumption, and I need to trigger the process again. I have two preliminary plans:

  1. Set acknowledge to javax.jms.Session.CLIENT_ACKNOWLEDGE. javax.jms.Message#acknowledge() is called to delete the message when processing succeeds, and javax.jms.Session#recover() is called to tell OpenMQ to redeliver the message when processing fails. But I couldn't find a way to set the maximum number of redeliveries and the time interval between redeliveries.

  2. Set acknowledge to javax.jms.Session.AUTO_ACKNOWLEDGE. Send a new message (containing the original message and the processing times) to a new queue each time an exception occurs, and I want to be able to set the delay time. However, I can't find a way to set the delay time of the message.

0

There are 0 answers