Transactional JMS Component generating lots of advisory messages
thomasbarnes Apr 21, 2010 5:02 PM
*Transactional JMS Component Generating Lots of Advisory Messages*
I would like to setup a route that utilizes transactional delivery of JMS messages to avoid dropping messages in the event of failures. To do this I have utilized the recommended configuration in the Camel Transaction documentation (utilizing version 2.2). Here is a sample (also included in attached file):
<camelContext id="camel" xmlns="http://camel.apache.org/schema/spring">
<route>
<from uri="jmstx:example.A"/>
<to uri="jmstx:example.B"/>
</route>
</camelContext>
 
<!-- JmsComponent Transactional Delivery of JMS Messages -->
<bean id="jmstx" class="org.apache.camel.component.jms.JmsComponent">
<property name="configuration" ref="jmsConfig" />
</bean>
<bean id="jmsConfig" class="org.apache.camel.component.jms.JmsConfiguration">
<property name="connectionFactory" ref="jmsConnectionFactory"/>
<property name="transactionManager" ref="jmsTransactionManager"/>
<property name="transacted" value="true"/>
</bean>
<bean id="jmsTransactionManager" class="org.springframework.jms.connection.JmsTransactionManager">
<property name="connectionFactory" ref="jmsConnectionFactory" />
</bean>
<bean id="jmsConnectionFactory" class="org.apache.activemq.ActiveMQConnectionFactory">
<property name="brokerURL" value="vm://localhost?create=false&waitForStart=10000" />
<property name="userName" value="${activemq.username}" />
<property name="password" value="${activemq.password}" />
</bean>
Before even creating any jms messages that are handled by this route I receive lots of ActiveMQ.Advisory.Connection and ActiveMQ.Advisory.Queue messages. Here is a sample of the ActiveMQ logs with log4j root logger set to DEBUG:
2010-04-21 13:38:18,387 | DEBUG | Setting up new connection id: ID:tbarneswin7-60077-1271882288129-2:8, address: vm://localhost#14 | org.apache.activemq.broker.TransportConnection | VMTransport: vm://localhost#15
2010-04-21 13:38:18,387 | DEBUG | localhost adding consumer: ID:tbarneswin7-60077-1271882288129-2:8:-1:1 for destination: topic://ActiveMQ.Advisory.TempQueue,topic://ActiveMQ.Advisory.TempTopic | org.apache.activemq.broker.region.AbstractRegion | VMTransport: vm://localhost#15
2010-04-21 13:38:19,392 | DEBUG | ID:tbarneswin7-60077-1271882288129-2:8:1 Transaction Commit :null | org.apache.activemq.ActiveMQSession | DefaultMessageListenerContainer-1
2010-04-21 13:38:19,393 | DEBUG | localhost removing consumer: ID:tbarneswin7-60077-1271882288129-2:8:-1:1 for destination: topic://ActiveMQ.Advisory.TempQueue,topic://ActiveMQ.Advisory.TempTopic | org.apache.activemq.broker.region.AbstractRegion | VMTransport: vm://localhost#15
2010-04-21 13:38:19,393 | DEBUG | remove connection id: ID:tbarneswin7-60077-1271882288129-2:8 | org.apache.activemq.broker.TransportConnection | VMTransport: vm://localhost#15
2010-04-21 13:38:19,395 | DEBUG | Stopping connection: vm://localhost#14 | org.apache.activemq.broker.TransportConnection | ActiveMQ Task
2010-04-21 13:38:19,395 | DEBUG | Stopped transport: vm://localhost#14 | org.apache.activemq.broker.TransportConnection | ActiveMQ Task
2010-04-21 13:38:19,408 | DEBUG | Setting up new connection id: ID:tbarneswin7-60077-1271882288129-2:9, address: vm://localhost#16 | org.apache.activemq.broker.TransportConnection | VMTransport: vm://localhost#17
2010-04-21 13:38:19,409 | DEBUG | Connection Stopped: vm://localhost#14 | org.apache.activemq.broker.TransportConnection | ActiveMQ Task
2010-04-21 13:38:19,409 | DEBUG | localhost adding consumer: ID:tbarneswin7-60077-1271882288129-2:9:-1:1 for destination: topic://ActiveMQ.Advisory.TempQueue,topic://ActiveMQ.Advisory.TempTopic | org.apache.activemq.broker.region.AbstractRegion | VMTransport: vm://localhost#17
2010-04-21 13:38:20,411 | DEBUG | ID:tbarneswin7-60077-1271882288129-2:9:1 Transaction Commit :null | org.apache.activemq.ActiveMQSession | DefaultMessageListenerContainer-1
2010-04-21 13:38:20,411 | DEBUG | localhost removing consumer: ID:tbarneswin7-60077-1271882288129-2:9:-1:1 for destination: topic://ActiveMQ.Advisory.TempQueue,topic://ActiveMQ.Advisory.TempTopic | org.apache.activemq.broker.region.AbstractRegion | VMTransport: vm://localhost#17
2010-04-21 13:38:20,412 | DEBUG | remove connection id: ID:tbarneswin7-60077-1271882288129-2:9 | org.apache.activemq.broker.TransportConnection | VMTransport: vm://localhost#17
2010-04-21 13:38:20,413 | DEBUG | Stopping connection: vm://localhost#16 | org.apache.activemq.broker.TransportConnection | ActiveMQ Task
2010-04-21 13:38:20,414 | DEBUG | Stopped transport: vm://localhost#16 | org.apache.activemq.broker.TransportConnection | ActiveMQ Task
2010-04-21 13:38:20,415 | DEBUG | Connection Stopped: vm://localhost#16 | org.apache.activemq.broker.TransportConnection | ActiveMQ Task
2010-04-21 13:38:20,416 | DEBUG | Setting up new connection id: ID:tbarneswin7-60077-1271882288129-2:10, address: vm://localhost#18 | org.apache.activemq.broker.TransportConnection | VMTransport: vm://localhost#19
My questions: Is there a problem in my camel configuration. Are these connections starting/stopping the expected behavior when utilizing a transactional JMS endpoint? What can I do to prevent the root cause of these connections coming and going?
Thanks for any assistance.
Regards,
Thomas
-
camel.xml 1.7 KB