3 Replies Latest reply on May 4, 2011 2:56 AM by marcelcasado

    Transactional JMS Component generating lots of advisory messages

    thomasbarnes

       

      *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

       

       

        • 1. Re: Transactional JMS Component generating lots of advisory messages
          marcelcasado

          Hi,

           

          I'm having the same problem. Thousands of Advisory.Queue messages are generated. I'm looking to the advisory messages and all are for "adding" the same queue all over:

           

          ActiveMQ.Advisory.Queue: ActiveMQMessage {commandId = 0, responseRequired = false, messageId = ID:flameout.rap.ucar.edu-41228-1304481254510-1:1:0:0:252497, originalDestination = null, originalTransactionId = null, producerId = ID:flameout.rap.ucar.edu-41228-1304481254510-1:1:0:0, destination = topic://ActiveMQ.Advisory.Queue, transactionId = null, expiration = 0, timestamp = 0, arrival = 0, brokerInTime = 1304482142098, brokerOutTime = 1304482142098, correlationId = null, replyTo = null, persistent = false, type = Advisory, priority = 0, groupID = null, groupSequence = 0, targetConsumerId = null, compressed = false, userID = null, content = null, marshalledProperties = org.apache.activemq.util.ByteSequence@2af12142, dataStructure = DestinationInfo {commandId = 0, responseRequired = false, connectionId = ID:flameout.rap.ucar.edu-56460-1304481387833-0:2, destination = queue://pubsub.handshake, operationType = 0, timeout = 0, brokerPath = null}, redeliveryCounter = 0, size = 0, properties = {originBrokerName=flameout-broker, originBrokerId=ID:flameout.rap.ucar.edu-41228-1304481254510-0:1, originBrokerURL=tcp://flameout.rap.ucar.edu:61916}, readOnlyProperties = true, readOnlyBody = true, droppable = false}

           

          ActiveMQ.Advisory.Queue: ActiveMQMessage {commandId = 0, responseRequired = false, messageId = ID:flameout.rap.ucar.edu-41228-1304481254510-1:1:0:0:252539, originalDestination = null, originalTransactionId = null, producerId = ID:flameout.rap.ucar.edu-41228-1304481254510-1:1:0:0, destination = topic://ActiveMQ.Advisory.Queue, transactionId = null, expiration = 0, timestamp = 0, arrival = 0, brokerInTime = 1304482142194, brokerOutTime = 1304482142194, correlationId = null, replyTo = null, persistent = false, type = Advisory, priority = 0, groupID = null, groupSequence = 0, targetConsumerId = null, compressed = false, userID = null, content = null, marshalledProperties = org.apache.activemq.util.ByteSequence@5809b8de, dataStructure = DestinationInfo {commandId = 0, responseRequired = false, connectionId = ID:flameout.rap.ucar.edu-56460-1304481387833-0:2, destination = queue://pubsub.handshake, operationType = 0, timeout = 0, brokerPath = null}, redeliveryCounter = 0, size = 0, properties = {originBrokerName=flameout-broker, originBrokerId=ID:flameout.rap.ucar.edu-41228-1304481254510-0:1, originBrokerURL=tcp://flameout.rap.ucar.edu:61916}, readOnlyProperties = true, readOnlyBody = true, droppable = false}

           

          Also having the same problem with Advisory.TempQueues topic.

           

             

          I'm using :

          camel 2.2.6

          org.springframework.jms - 3.0.5.RELEASE

          amq 5.4.2 and also 5.5

           

          Thanks,

           

          -Marcel

          • 2. Re: Transactional JMS Component generating lots of advisory messages
            thomasbarnes

            My issue was solved by FuseSource support (thanks Claus) by pointing to updated documentation at the following link:

             

            http://camel.apache.org/activemq.html

             

            Specifically, I followed the samples in the "Using connection pooling" section of the page and my constant advisories messages and transaction aborts stopped.  If you need more information I can supply by final Camel configuration.

            • 3. Re: Transactional JMS Component generating lots of advisory messages
              marcelcasado

              Thanks Thomas for your kind reply.

               

              So if I understand OK you changed from using the camel "JmsComponent" to use "ActiveMQComponent". In my case I'm already using a connection pool. What are the benefits of using "ActiveMQComponent" instead. Are any features not supported by the "JmsComponent" that are supported by "ActiveMQComponent"  ?

               

              I attached my blueprint configuration in case some of the Camel experts can take a look and give advise.

               

              Using :  camel 2.2.6, spring 3.0.5, activemq 5.4.2, fuse-servicemix 4.3.1

               

              Thanks again.

               

              -Marcel