You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by yxzhao <yx...@stonewain.com> on 2013/04/03 16:31:51 UTC

Camel/JMS with Atomikos UserTransactionManager not consuming Messages

Hi All,

We have an app using Camel to schedule jobs and Atomikos to manage
transactions accessing IBM MQ queues and Oracle DB. Once a while message
consuming routes stop consuming messages completely without indication of
any abnormal conditions.

Does anyone out there experience this or something similar? 

By the way, when Atomikos manages transactions, do camel routes have to
specify transacted work explicitly or Atomikos can detect the units of work
automatically based on route definitions?

Thanks in advance for any help, hints or suggestions.







--
View this message in context: http://camel.465427.n5.nabble.com/Camel-JMS-with-Atomikos-UserTransactionManager-not-consuming-Messages-tp5730286.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Camel/JMS with Atomikos UserTransactionManager not consuming Messages

Posted by Christian Müller <ch...@gmail.com>.
If you do not use transacted (or policy) in your route, Camel will not
start a transaction.

[1] http://camel.apache.org/transactional-client.html

Best,
Christian


On Tue, Apr 9, 2013 at 8:31 PM, yxzhao <yx...@stonewain.com> wrote:

> Yes, we have transacted configured with the objects of JmsComponent. I
> have a
> general question now on how transaction boundaries are marked in camel
> routes.
>
> I saw results of each database call in a split list is committed into
> database. I wonder how are other regular routes that don't have transacted
> configured are managed regarding to transactions.
>
> Could you please shed some light on this?
>
> Thanks.
>
>
>
> --
> View this message in context:
> http://camel.465427.n5.nabble.com/Camel-JMS-with-Atomikos-UserTransactionManager-not-consuming-Messages-tp5730286p5730602.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>

Re: Camel/JMS with Atomikos UserTransactionManager not consuming Messages

Posted by yxzhao <yx...@stonewain.com>.
Yes, we have transacted configured with the objects of JmsComponent. I have a
general question now on how transaction boundaries are marked in camel
routes. 

I saw results of each database call in a split list is committed into
database. I wonder how are other regular routes that don't have transacted
configured are managed regarding to transactions.

Could you please shed some light on this?

Thanks.



--
View this message in context: http://camel.465427.n5.nabble.com/Camel-JMS-with-Atomikos-UserTransactionManager-not-consuming-Messages-tp5730286p5730602.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Camel/JMS with Atomikos UserTransactionManager not consuming Messages

Posted by Christian Müller <ch...@gmail.com>.
Because I use "org.apache.commons.dbcp.managed.BasicManagedDataSource"
instead of "com.atomikos.jdbc.AtomikosDataSourceBean".
I also use "org.apache.activemq.pool.XaPooledConnectionFactory" instead of
"com.atomikos.jms.AtomikosConnectionFactoryBean".

Pascal Leclercq from Atomikos already forked my Git repo and made some
changes on this configuration. He use the "com.atomikos.jdbc.
AtomikosDataSourceBean" and
"com.atomikos.jms.AtomikosConnectionFactoryBean". May be his configuration
works also for you [1].
Make sure you use transacted=true in
"org.apache.activemq.camel.component.ActiveMQComponent".

[1]
https://github.com/pascalleclercq/camel-in-transaction/blob/master/src/test/resources/META-INF/spring/JmsAndJdbcXATransactionSampleWithAtomikosTest-context.xml

Best,
Christian


On Thu, Apr 4, 2013 at 8:38 PM, yxzhao <yx...@stonewain.com> wrote:

> I saw you commented out the dataSource declaration with
> com.atomikos.jdbc.AtomikosDataSourceBean on the bottom and used
> org.apache.commons.dbcp.managed.BasicManagedDataSource instead.
>
> What was the reason for that? I don't see a way of setting the jta
> transaction manager with atomikos data source bean. Is that the reason?
>
> Thanks.
>
>
>
> --
> View this message in context:
> http://camel.465427.n5.nabble.com/Camel-JMS-with-Atomikos-UserTransactionManager-not-consuming-Messages-tp5730286p5730355.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>

Re: Camel/JMS with Atomikos UserTransactionManager not consuming Messages

Posted by yxzhao <yx...@stonewain.com>.
I saw you commented out the dataSource declaration with
com.atomikos.jdbc.AtomikosDataSourceBean on the bottom and used
org.apache.commons.dbcp.managed.BasicManagedDataSource instead. 

What was the reason for that? I don't see a way of setting the jta
transaction manager with atomikos data source bean. Is that the reason?

Thanks.



--
View this message in context: http://camel.465427.n5.nabble.com/Camel-JMS-with-Atomikos-UserTransactionManager-not-consuming-Messages-tp5730286p5730355.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Camel/JMS with Atomikos UserTransactionManager not consuming Messages

Posted by Christian Müller <ch...@gmail.com>.
I use the following configuration [1] (with ActiveMQ).

[1]
https://github.com/muellerc/camel-in-transaction/blob/master/src/test/resources/META-INF/spring/JmsAndJdbcXATransactionSampleWithAtomikosTest-context.xml

Best,
Christian



On Wed, Apr 3, 2013 at 4:31 PM, yxzhao <yx...@stonewain.com> wrote:

> Hi All,
>
> We have an app using Camel to schedule jobs and Atomikos to manage
> transactions accessing IBM MQ queues and Oracle DB. Once a while message
> consuming routes stop consuming messages completely without indication of
> any abnormal conditions.
>
> Does anyone out there experience this or something similar?
>
> By the way, when Atomikos manages transactions, do camel routes have to
> specify transacted work explicitly or Atomikos can detect the units of work
> automatically based on route definitions?
>
> Thanks in advance for any help, hints or suggestions.
>
>
>
>
>
>
>
> --
> View this message in context:
> http://camel.465427.n5.nabble.com/Camel-JMS-with-Atomikos-UserTransactionManager-not-consuming-Messages-tp5730286.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>