JMS connections are leaked when closing OSGi bundle which contains a Camel route that consumes from ActiveMQ

Solution In Progress - Updated -


Stopping a Camel route that consumes from ActiveMQ leaks JMS connections into the broker. The connection is not closed and remains registered in the broker's JMX view.
Subsequent restarts and stops of the Camel route leak a connection each time.

The camel-jms component is configured to use Springs SingleConnectionFactory. The jms configuration reads:

<bean id="amq" class="org.apache.activemq.camel.component.ActiveMQComponent" >
  <property name="connectionFactory" ref="singleCF" />
  <property name="useSingleConnection" value="true" />
  <property name="usePooledConnection" value="false" />
  <property name="preserveMessageQos" value="true" />

<bean id="singleCF" class="org.springframework.jms.connection.SingleConnectionFactory" >
  <property name="targetConnectionFactory" ref="AMQCF" />
  <property name="reconnectOnException" value="true" />

<bean id="AMQCF" class="org.apache.activemq.ActiveMQConnectionFactory">
  <property name="userName" value="admin" />
  <property name="password" value="admin" />
  <property name="brokerURL" value="tcp://localhost:61616" />
  <property name="copyMessageOnSend" value="false" />
  <property name="useAsyncSend" value="true" />


  • JBoss Fuse 6.x
  • Fuse ESB Enterprise 7.x
  • Fuse ESB 4.x

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.

Current Customers and Partners

Log in for full access

Log In

New to Red Hat?

Learn more about Red Hat subscriptions

Using a Red Hat product through a public cloud?

How to access this content