Using Camel ActiveMQ component to send messages causes many TCP connections to be reestablished
Issue
With a camel route like that below, we see many TCP connections being created and torn down to mq-broker2
<camelContext id="transactionTestContext" xmlns="http://camel.apache.org/schema/blueprint">
<route>
<from uri="mq-tx-broker1:queue:input?acknowledgementModeName=SESSION_TRANSACTED&disableReplyTo=true&preserveMessageQos=true&concurrentConsumers=1&maxConcurrentConsumers=1&IdleTaskExecutionLimit=1&maxMessagesPerTask=1"/>
<to uri="log:com.example.mq?level=DEBUG&showExchangeId=true&showProperties=true&showHeaders=true&showException=true&showBody=false" id="to8"/>
<to uri="mq-broker2:queue:output.GW02?preserveMessageQos=true&includeSentJMSMessageID=true" id="to9"/>
</route>
</camelContext>
<bean id="jmsConnectionFactory" class="org.apache.activemq.ActiveMQConnectionFactory">
<property name="brokerURL" value="tcp://localhost:61610"/>
<property name="userName" value="admin" />
<property name="password" value="admin" />
</bean>
<bean id="mq-tx-broker1-config"
class="org.apache.activemq.camel.component.ActiveMQConfiguration">
<property name="connectionFactory" ref="jmsConnectionFactory" />
<property name="transacted" value="true" />
<property name="cacheLevelName" value="CACHE_CONSUMER" />
</bean>
<bean id="mq-tx-broker1" class="org.apache.activemq.camel.component.ActiveMQComponent">
<property name="configuration" ref="mq-tx-broker1-config" />
</bean>
<!-- setup camel-jms broker 2 -->
<bean id="mq-broker2-config"
class="org.apache.activemq.camel.component.ActiveMQConfiguration">
<property name="brokerURL" value="tcp://localhost:61618" />
<property name="userName" value="admin" />
<property name="password" value="admin" />
<property name="cacheLevelName" value="CACHE_CONNECTION" />
</bean>
<bean id="mq-broker2" class="org.apache.activemq.camel.component.ActiveMQComponent">
<property name="configuration" ref="mq-broker2-config" />
</bean>
Environment
JBoss A-MQ 6.0
Subscriber exclusive content
A Red Hat subscription provides unlimited access to our knowledgebase of over 48,000 articles and solutions.
Welcome! Check out the Getting Started with Red Hat page for quick tours and guides for common tasks.
