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

Solution In Progress - Updated -

Issue

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>

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

<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" />
</bean>

Environment

  • 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 of over 48,000 articles and solutions.

Current Customers and Partners

Log in for full access

Log In
Close

Welcome! Check out the Getting Started with Red Hat page for quick tours and guides for common tasks.