activemq-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Gary Tully <gary.tu...@gmail.com>
Subject Re: QueueBrowser in XA Transaction?
Date Fri, 23 Apr 2010 15:59:00 GMT
Ah, ok, so that exception is the only way you know that it is not working...
an XASession is transacted so it does require an active XA transaction.

Best post your entire spring context and maybe post to camel-users who will
be more familiar with the <transacted> tag

On 23 April 2010 15:27, dnn <Daniel.Nawrocki@ngc.com> wrote:

>
>
> Gary Tully wrote:
> >
> > this seems to be another case of
> > https://issues.apache.org/activemq/browse/AMQ-2659 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:
>
> <route>
>   <from uri="timer:test?period=1000 />
>   <transacted />
>   <to uri="myQueueBrowser" />
> </route>
>
> 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()
>      {
>         @Override
>         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
> route.
>
> I can post my Spring configuration if anyone thinks it will help.
> --
> View this message in context:
> http://old.nabble.com/QueueBrowser-in-XA-Transaction--tp28341411p28342060.html
> Sent from the ActiveMQ - User mailing list archive at Nabble.com.
>
>


-- 
http://blog.garytully.com

Open Source Integration
http://fusesource.com

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message