I have a java client that processes messages from HornetQ. The processing may fail due to temporary network problems, which I handle by throwing an exception and configuring the queue to attempt re-delivery.
However, processing may fail due to other reasons that mean it's not worth attempting re-delivery.
Now, I could prevent re-delivery by not throwing an exception and letting the client consume the message. But I don't want to do this. I would like some way of rejecting the message and, in effect, saying to the queue: "don't bother re-delivering this message - it can go straight to the dead-letter-queue".
Is there any way of doing this?