I am processing a message in the onMessage() method of the MDB. While processing this message, I find that the destination where I am sending the message to is unavailable. So, I would rollback this transaction, so that the message is put back into the queue. But This is going To back of the queue. So next time when onMessage() is called it is getting message from the front of the queue.Because of this i will lose the order of messages.On rolebacking is there any way to put message to front of the queue so that next onMessage will process the same message which is rolebacked.
You can add a delay to redelivery. Check the wiki.