activemq-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dnn <>
Subject Re: QueueBrowser in XA Transaction?
Date Fri, 23 Apr 2010 14:27:38 GMT

Gary Tully wrote:
> this seems to be another case of
> and you also have a
> valid
> use case.

That's certainly an interesting bug, but I don't think it applies to me.  An
XA transaction definitely should have been started.  The camel route that
start the whole shebang is:

   <from uri="timer:test?period=1000 />
   <transacted />
   <to uri="myQueueBrowser" />

As I understand it, the <transacted/> tag will start a transaction because
none is currently active for the thread (I'm using PROPAGATION_REQUIRED). 
Inside the myQueueBrowser processor, I am using the following code:

      jmsTemplate.browse( getSourceQueue(), new BrowserCallback()
         public Object doInJms( Session session, QueueBrowser browser )
throws JMSException
            Enumeration< ? > e = browser.getEnumeration();
            while( e.hasMoreElements() )
               Object o = e.nextElement();
               // do some stuff with the message
            return null;
      } );

Where jmsTemplate is an instance of the Spring JmsTemplate class with
sessionTransacted=true.  From the Spring code, it appears to be using
PROPAGATION_REQUIRED, which will join the transaction started in the Camel

I can post my Spring configuration if anyone thinks it will help.
View this message in context:
Sent from the ActiveMQ - User mailing list archive at

View raw message