You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@activemq.apache.org by "Tadayoshi Sato (JIRA)" <ji...@apache.org> on 2017/02/16 09:45:42 UTC

[jira] [Updated] (AMQ-6603) Excessive number of consumers when used with PooledConnectionFactory and Failover transport

     [ https://issues.apache.org/jira/browse/AMQ-6603?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Tadayoshi Sato updated AMQ-6603:
--------------------------------
    Description: 
When {{PooledConnectionFactory}} is used with Failover transport, insufficient access control settings on the broker result in an excessive number of consumer objects on the broker once the access control settings are properly set. 

Here is an example Spring XML configuration:

{code:xml}
<beans ...>

  <bean id="jmsConnectionFactory" class="org.apache.activemq.ActiveMQConnectionFactory">
    <property name="brokerURL" value="failover:(tcp://localhost:61616)" />
    <property name="userName" value="test" />
    <property name="password" value="test" />
  </bean>

  <bean id="pooledConnectionFactory" class="org.apache.activemq.pool.PooledConnectionFactory">
    <property name="connectionFactory" ref="jmsConnectionFactory" />
    <property name="maxConnections" value="10" />
  </bean>

  <bean id="jmsContainer" class="org.springframework.jms.listener.DefaultMessageListenerContainer">
    <property name="connectionFactory" ref="pooledConnectionFactory" />
    <property name="destinationName" value="TEST" />
    <property name="messageListener" ref="messageListener" />
    <property name="concurrentConsumers" value="10" />
  </bean>

  <bean id="messageListener" class="com.redhat.issues.amq.SpringJmsConsumer" />

</beans>
{code}

In this configuration we expect only one connection and 10 consumers for {{TEST}} queue, but after following the reproducer steps we see around 10 connections and 100 consumers for the queue on hawtio. In the above configuration Spring DMLC is used but we can reproduce the issue without Spring.

  was:
When {{PooledConnectionFactory}} is used with Failover transport, insufficient access control settings on the broker result in an excessive number of consumer objects on the broker once the access control settings are properly set. 

Here is an example Spring XML configuration:

{code:xml}
<beans ...>

  <bean id="jmsConnectionFactory" class="org.apache.activemq.ActiveMQConnectionFactory">
    <property name="brokerURL" value="failover:(tcp://localhost:61616)" />
    <property name="userName" value="test" />
    <property name="password" value="test" />
  </bean>

  <bean id="pooledConnectionFactory" class="org.apache.activemq.pool.PooledConnectionFactory">
    <property name="connectionFactory" ref="jmsConnectionFactory" />
    <property name="maxConnections" value="10" />
  </bean>

  <bean id="jmsContainer" class="org.springframework.jms.listener.DefaultMessageListenerContainer">
    <property name="connectionFactory" ref="pooledConnectionFactory" />
    <property name="destinationName" value="TEST" />
    <property name="messageListener" ref="messageListener" />
    <property name="concurrentConsumers" value="10" />
  </bean>

  <bean id="messageListener" class="com.redhat.issues.amq.SpringJmsConsumer" />

</beans>
{code}

In this configuration we expect only one connection and 10 consumers for {{TEST}} queue, but after following the reproducer steps we see around 100 consumers for the queue on hawtio. In the above configuration Spring DMLC is used but we can reproduce the issue without Spring.


> Excessive number of consumers when used with PooledConnectionFactory and Failover transport
> -------------------------------------------------------------------------------------------
>
>                 Key: AMQ-6603
>                 URL: https://issues.apache.org/jira/browse/AMQ-6603
>             Project: ActiveMQ
>          Issue Type: Bug
>          Components: JMS client
>    Affects Versions: 5.14.3
>            Reporter: Tadayoshi Sato
>
> When {{PooledConnectionFactory}} is used with Failover transport, insufficient access control settings on the broker result in an excessive number of consumer objects on the broker once the access control settings are properly set. 
> Here is an example Spring XML configuration:
> {code:xml}
> <beans ...>
>   <bean id="jmsConnectionFactory" class="org.apache.activemq.ActiveMQConnectionFactory">
>     <property name="brokerURL" value="failover:(tcp://localhost:61616)" />
>     <property name="userName" value="test" />
>     <property name="password" value="test" />
>   </bean>
>   <bean id="pooledConnectionFactory" class="org.apache.activemq.pool.PooledConnectionFactory">
>     <property name="connectionFactory" ref="jmsConnectionFactory" />
>     <property name="maxConnections" value="10" />
>   </bean>
>   <bean id="jmsContainer" class="org.springframework.jms.listener.DefaultMessageListenerContainer">
>     <property name="connectionFactory" ref="pooledConnectionFactory" />
>     <property name="destinationName" value="TEST" />
>     <property name="messageListener" ref="messageListener" />
>     <property name="concurrentConsumers" value="10" />
>   </bean>
>   <bean id="messageListener" class="com.redhat.issues.amq.SpringJmsConsumer" />
> </beans>
> {code}
> In this configuration we expect only one connection and 10 consumers for {{TEST}} queue, but after following the reproducer steps we see around 10 connections and 100 consumers for the queue on hawtio. In the above configuration Spring DMLC is used but we can reproduce the issue without Spring.



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)