What are my options for the following requirement:

Step 1: A consumer gets a message from a broker's queue (which will likely
use roundrobin).
Step 2: It realizes that it doesn't want this particular message at this
time, so the broker should deliver it to another consumer.

Here are the options I can think of, please tell me if there are more and if
one is better:

1. I use CLIENT_ACKKNOWLEDGE sessions and close the session such that the
Broker can then distribute the message to another consumer.
    Downside: I have to incur the cost of shutting down and restarting the
session.

2. I use SESSION_TRANSACTED sessions and call a rollback with the hopes that
the same consumer doesn't get the message again.

3. I can consume the message from the Broker and produce it back on the
Broker, at the end of its queue.
    Downside: The message goes back on the end of the queue. Not clean.

NOTE: I don't believe I can use Message Selectors because the I need my
filter criteria to be dynamic.

Is there any cleaner way?
If transacted sessions is the answer, will this hurt me in performance?
-- 
View this message in context: 
http://www.nabble.com/If-I-want-to-rollback-a-message-tf3653356s2354.html#a10206088
Sent from the ActiveMQ - User mailing list archive at Nabble.com.

Reply via email to