activemq-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Mykola Paliyenko (JIRA)" <>
Subject [jira] Reopened: (AMQ-1045) PooledConnectionFactory does not work with the org.springframework.jms.listener.DefaultMessageListenerContainer in the failure case
Date Fri, 04 May 2007 14:07:35 GMT


Mykola Paliyenko reopened AMQ-1045:

Similar problem
4.1.1 rev 533993
sometimes when I shut down one of ActiveMQ servers that configured in JDBC master-slave way

DefaultMessageListenerContainer does not reconnect.
Messages are published but not consumed

Config of container
    <bean class="org.springframework.jms.listener.DefaultMessageListenerContainer">
        <property name="autoStartup" value="${jms.sms.start}" />
        <property name="concurrentConsumers" value="${jms.sms.concurrent.consumers}" />
        <property name="connectionFactory" ref="jmsConnectionFactory" />
        <property name="destination" ref="jmsSmsDestination" />
        <property name="messageListener" ref="smsJmsListener" />
        <property name="sessionTransacted" value="true"></property>
Connection factory

	<bean id="jmsConnectionFactory"
		init-method="start" destroy-method="stop">
		<property name="connectionFactory">
				<property name="brokerURL"
					value="failover:(tcp://localhost:61616,tcp://localhost:61716)" />
				<property name="redeliveryPolicy">
					<bean class="org.apache.activemq.RedeliveryPolicy">
						<property name="backOffMultiplier" value="3"/>
						<property name="useExponentialBackOff" value="true"/>
						<property name="maximumRedeliveries" value="11"></property>
						<property name="initialRedeliveryDelay" value="2000"></property>

Also whenit reconeects it show such messages often

DEBUG AbstractRegion                 - Removing consumer: ID:MPaliyenkoN2-3962-1178284368281-1:0:1:2014
DEBUG AbstractRegion                 - Adding consumer: ID:MPaliyenkoN2-3962-1178284368281-1:0:1:2015
DEBUG AbstractRegion                 - Removing consumer: ID:MPaliyenkoN2-3962-1178284368281-1:0:1:2015
DEBUG AbstractRegion                 - Adding consumer: ID:MPaliyenkoN2-3962-1178284368281-1:0:1:2016
DEBUG AbstractRegion                 - Removing consumer: ID:MPaliyenkoN2-3962-1178284368281-1:0:1:2016
DEBUG AbstractRegion                 - Adding consumer: ID:MPaliyenkoN2-3962-1178284368281-1:0:1:2017
DEBUG AbstractRegion                 - Removing consumer: ID:MPaliyenkoN2-3962-1178284368281-1:0:1:2017
DEBUG AbstractRegion                 - Adding consumer: ID:MPaliyenkoN2-3962-1178284368281-1:0:1:2018

After I switched several times the messages dissapeared.

Server config


<!-- Allows us to use system properties as variables in this configuration file -->
<bean class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer"/>

<broker brokerName="localhost" useJmx="true" xmlns="">

<!-- Use the following to set the broker memory limit
<usageManager id="memory-manager" limit="20 MB"/>

<!-- Use the following to configure how ActiveMQ is exposed in JMX
<managementContext connectorPort="1099" jmxDomainName="org.apache.activemq"/>

<jdbcPersistenceAdapter dataSource="#mysql-ds"/>

<transportConnector name="openwire" uri="tcp://localhost:61616"/>
<transportConnector name="ssl" uri="ssl://localhost:61617"/>
<transportConnector name="stomp" uri="stomp://localhost:61613"/>

<!-- by default just auto discover the other brokers -->
<networkConnector name="default-nc" uri="multicast://default"/>
<networkConnector name="host1 and host2" uri="static://(tcp://host1:61616,tcp://host2:61616)"


<bean id="mysql-ds" class="org.apache.commons.dbcp.BasicDataSource" destroy-method="close">
<property name="driverClassName" value="com.mysql.jdbc.Driver"/>
<property name="url" value="jdbc:mysql://localhost/sonoportal?relaxAutoCommit=true"/>
<property name="username" value="root"/>
<property name="password" value=""/>


please suggest

> PooledConnectionFactory does not work with the org.springframework.jms.listener.DefaultMessageListenerContainer
in the failure case
> -----------------------------------------------------------------------------------------------------------------------------------
>                 Key: AMQ-1045
>                 URL:
>             Project: ActiveMQ
>          Issue Type: Bug
>    Affects Versions: 4.0
>            Reporter: Hiram Chirino
>         Assigned To: Hiram Chirino
>             Fix For: 4.1.1, 4.2.0
> The DefaultMessageListenerContainer has retry logic built into it. When a connection
dies it tried to reconnect by getting a new connection from the ConnectionFactory. Since the
PooledConenctionFactory has one Connection it, it keeps on trying to give out the Connection
that died. We would like the PooledConnectionFactory to be able to "evict" the dead connection
and create a new one.

This message is automatically generated by JIRA.
You can reply to this email to add a comment to the issue online.

View raw message