activemq-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jlpedrosa <>
Subject Rollback/NACK a single message
Date Thu, 14 Nov 2013 14:42:52 GMT
Hi All,We are coding an application to process events in a queue. We are
using NMS - ActiveMQ 1.6.
In my mental model the best transactionality comes with:
If the proccess goes OK, the message is acknoledge, up to there no problem.
But message has no rollback/nack method. So I don't really know how to
perform that patter. Should I open a session per message? (As I want
multiple threads running at the same time, sequential is not an option).
somthing like:
/IMessage m = messageListener.GetMessage();
ThreadPool.QueueUserWorkItem(new WaitCallback(this.DispatchMessage), m);
/public void DispatchMessage(Object messageToDispatch)
            IMessage m = messageToDispatch as IMessage;
                //Convert to Event.
                Event ev = UnMarshallMessage(m); --> not relevant code
                //Create an instance of the executor
                EventProccessor executor =
Activator.CreateInstance(ExecutorType) as EventProccessor ;
                //Invoke the executor
                //commit the message                
            catch (Exception ex)
                log.Error("Error processing the message", ex); 
                m.Rollback() --> does not exist
Thanks in advance for any suggestion,
Jose Luis

View this message in context:
Sent from the ActiveMQ - User mailing list archive at
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message