You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by Claus Ibsen <cl...@gmail.com> on 2009/12/17 10:43:43 UTC

Re: Atomikos Transactions Created In Polling Type Fashion By ActiveMQ Component

On Wed, Dec 16, 2009 at 9:59 PM, greenbean <Ke...@ngc.com> wrote:
>
> We are using Camel 2.0, ActiveMQ 5.3, Oracle, and the latest Atomikos for an
> XA transaction manager with Spring 2.5.  Everything seems to work fine with
> transaction commits and rollbacks.  However, Atomikos is constantly creating
> transactions associated with routes that consume messages using the
> ActiveMQComponent.  We have three queues, and five threads each consuming
> from those queues.  We can see at load up that 15 transactions are created
> and then committed.  Transactions are constantly created and committed even
> when no messages are flowing through the queues.
>
> If we comment out the routes that consume from queues, then the transactions
> are not constantly created.
>
> Also, you can see from the log snip that the transaction actions are
> associated with a DefaultMessageListenerContainer.

This is spring-jms which does the polling of the JMS messages.

>
> Is there some way to prevent these transactions from constantly being
> created when the queues are empty and no message processing is occurring?
>

I think spring-jms polls the JMS queues on intervals and that may be
why it creates all these transactions even if the queues are empty.

Have you googled / search for this with spring-jms + atomikos as I
would assume its a general thing and just the way it is.


> Thanks.
>
> 2009-12-16 15:51:45,006 INFO  [atomikos] (DefaultMessageListenerContainer-1)
> commit() done (by application) of transaction 127.0.0.1.tm0100900453
> 2009-12-16 15:51:45,010 INFO  [atomikos] (DefaultMessageListenerContainer-1)
> createCompositeTransaction ( 300000 ): created new ROOT transaction with id
> 127.0.0.1.tm0101300453
> 2009-12-16 15:51:45,112 INFO  [atomikos] (DefaultMessageListenerContainer-1)
> commit() done (by application) of transaction 127.0.0.1.tm0101000453
> 2009-12-16 15:51:45,116 INFO  [atomikos] (DefaultMessageListenerContainer-1)
> createCompositeTransaction ( 300000 ): created new ROOT transaction with id
> 127.0.0.1.tm0101400453
> 2009-12-16 15:51:45,196 INFO  [atomikos] (DefaultMessageListenerContainer-1)
> commit() done (by application) of transaction 127.0.0.1.tm0101100453
> 2009-12-16 15:51:45,201 INFO  [atomikos] (DefaultMessageListenerContainer-1)
> createCompositeTransaction ( 300000 ): created new ROOT transaction with id
> 127.0.0.1.tm0101500453
> 2009-12-16 15:51:45,240 INFO  [atomikos] (DefaultMessageListenerContainer-1)
> commit() done (by application) of transaction 127.0.0.1.tm0101200453
> 2009-12-16 15:51:45,244 INFO  [atomikos] (DefaultMessageListenerContainer-1)
> createCompositeTransaction ( 300000 ): created new ROOT transaction with id
> 127.0.0.1.tm0101600453
> --
> View this message in context: http://old.nabble.com/Atomikos-Transactions-Created-In-Polling-Type-Fashion-By-ActiveMQ-Component-tp26818355p26818355.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>
>



-- 
Claus Ibsen
Apache Camel Committer

Author of Camel in Action: http://www.manning.com/ibsen/
Open Source Integration: http://fusesource.com
Blog: http://davsclaus.blogspot.com/
Twitter: http://twitter.com/davsclaus

Re: Atomikos Transactions Created In Polling Type Fashion By ActiveMQ Component

Posted by Claus Ibsen <cl...@gmail.com>.
On Thu, Dec 17, 2009 at 10:43 AM, Claus Ibsen <cl...@gmail.com> wrote:
> On Wed, Dec 16, 2009 at 9:59 PM, greenbean <Ke...@ngc.com> wrote:
>>
>> We are using Camel 2.0, ActiveMQ 5.3, Oracle, and the latest Atomikos for an
>> XA transaction manager with Spring 2.5.  Everything seems to work fine with
>> transaction commits and rollbacks.  However, Atomikos is constantly creating
>> transactions associated with routes that consume messages using the
>> ActiveMQComponent.  We have three queues, and five threads each consuming
>> from those queues.  We can see at load up that 15 transactions are created
>> and then committed.  Transactions are constantly created and committed even
>> when no messages are flowing through the queues.

If you try with 2.2-SNAPSHOT then the number of transactions used at
runtime may be lowered. Or at least Camel does not use fine grained
spring transaction as much anymore one when its really needed. As
Camel know is clever and knows it can run in the same TX template.
However I would assume Spring TM would detect this itself and handle
it, but that may be different when XA is involved.

However the outcome in the end is the same in 2.0 and 2.2.


>>
>> If we comment out the routes that consume from queues, then the transactions
>> are not constantly created.
>>
>> Also, you can see from the log snip that the transaction actions are
>> associated with a DefaultMessageListenerContainer.
>
> This is spring-jms which does the polling of the JMS messages.
>
>>
>> Is there some way to prevent these transactions from constantly being
>> created when the queues are empty and no message processing is occurring?
>>
>
> I think spring-jms polls the JMS queues on intervals and that may be
> why it creates all these transactions even if the queues are empty.
>
> Have you googled / search for this with spring-jms + atomikos as I
> would assume its a general thing and just the way it is.
>
>
>> Thanks.
>>
>> 2009-12-16 15:51:45,006 INFO  [atomikos] (DefaultMessageListenerContainer-1)
>> commit() done (by application) of transaction 127.0.0.1.tm0100900453
>> 2009-12-16 15:51:45,010 INFO  [atomikos] (DefaultMessageListenerContainer-1)
>> createCompositeTransaction ( 300000 ): created new ROOT transaction with id
>> 127.0.0.1.tm0101300453
>> 2009-12-16 15:51:45,112 INFO  [atomikos] (DefaultMessageListenerContainer-1)
>> commit() done (by application) of transaction 127.0.0.1.tm0101000453
>> 2009-12-16 15:51:45,116 INFO  [atomikos] (DefaultMessageListenerContainer-1)
>> createCompositeTransaction ( 300000 ): created new ROOT transaction with id
>> 127.0.0.1.tm0101400453
>> 2009-12-16 15:51:45,196 INFO  [atomikos] (DefaultMessageListenerContainer-1)
>> commit() done (by application) of transaction 127.0.0.1.tm0101100453
>> 2009-12-16 15:51:45,201 INFO  [atomikos] (DefaultMessageListenerContainer-1)
>> createCompositeTransaction ( 300000 ): created new ROOT transaction with id
>> 127.0.0.1.tm0101500453
>> 2009-12-16 15:51:45,240 INFO  [atomikos] (DefaultMessageListenerContainer-1)
>> commit() done (by application) of transaction 127.0.0.1.tm0101200453
>> 2009-12-16 15:51:45,244 INFO  [atomikos] (DefaultMessageListenerContainer-1)
>> createCompositeTransaction ( 300000 ): created new ROOT transaction with id
>> 127.0.0.1.tm0101600453
>> --
>> View this message in context: http://old.nabble.com/Atomikos-Transactions-Created-In-Polling-Type-Fashion-By-ActiveMQ-Component-tp26818355p26818355.html
>> Sent from the Camel - Users mailing list archive at Nabble.com.
>>
>>
>
>
>
> --
> Claus Ibsen
> Apache Camel Committer
>
> Author of Camel in Action: http://www.manning.com/ibsen/
> Open Source Integration: http://fusesource.com
> Blog: http://davsclaus.blogspot.com/
> Twitter: http://twitter.com/davsclaus
>



-- 
Claus Ibsen
Apache Camel Committer

Author of Camel in Action: http://www.manning.com/ibsen/
Open Source Integration: http://fusesource.com
Blog: http://davsclaus.blogspot.com/
Twitter: http://twitter.com/davsclaus