Camel ActiveMQ connection creates lots of null transaction commits
Issue
- We have noticed in our environment that we get a lot of DEBUG level messages like.
2014-06-20 16:57:03,820 | DEBUG | Camel (Process) thread #205 - JmsConsumer[QUEUE.TestQueue] | ActiveMQSession | 176 - org.apache.activemq.activemq-core - 5.7.0.fuse-71-047 | ID:3216-1403297317359-39:1:6 Transaction Commit :null
2014-06-20 16:57:03,820 | DEBUG | Camel (Process) thread #205 - JmsConsumer[QUEUE.TestQueue] | ActiveMQSession | 176 - org.apache.activemq.activemq-core - 5.7.0.fuse-71-047 | ID:33216-1403297317359-39:1:15 Transaction Commit :null
2014-06-20 16:57:03,820 | DEBUG | Camel (Process) thread #205 - JmsConsumer[Queue.TestQueue] | ActiveMQSession | 176 - org.apache.activemq.activemq-core - 5.7.0.fuse-71-047 | ID:33216-1403297317359-39:1:15 Transaction Rollback, txid:null
-
While everything is working correctly, we believe we might be using transactions with Spring and ActiveMQ in camel incorrectly causing null transactions to created and committed continually.
-
Below is our spring for creating the activemq bean for camel. Is this correct/best?
<bean class="org.apache.activemq.pool.PooledConnectionFactory" id="jmsConnectionFactory">
<property name="connectionFactory">
<bean class="org.apache.activemq.ActiveMQConnectionFactory">
<property name="brokerURL">
<value>${activeMQServer}</value>
</property>
<property name="userName">
<value>${activeMQServerUserName}</value>
</property>
<property name="password">
<value>${activeMQServerPassword}</value>
</property>
</bean>
</property>
</bean>
<bean name="activemq" class="org.apache.activemq.camel.component.ActiveMQComponent">
<property name="connectionFactory" ref="jmsConnectionFactory"></property>
<property name="transactionManager" ref="transactionManager"></property>
<property name="transacted" value="true"></property>
<property name="cacheLevelName" value="CACHE_CONSUMER"></property>
</bean>
<bean id="transactionManager" class="org.springframework.jms.connection.JmsTransactionManager">
<property name="connectionFactory" ref="jmsConnectionFactory"></property>
</bean>
<bean id="PROPAGATION_REQUIRED" class="org.apache.camel.spring.spi.SpringTransactionPolicy">
<property name="transactionManager" ref="transactionManager"></property>
</bean>
Environment
- Fuse ESB
- 7.1
- Red Hat JBoss Fuse
- 6.x
- Red Hat JBoss A-MQ
- 6.x
Subscriber exclusive content
A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.