[
https://issues.apache.org/activemq/browse/AMQ-1045?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
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>
</bean>
Connection factory
<bean id="jmsConnectionFactory"
class="org.apache.activemq.pool.PooledConnectionFactory"
init-method="start" destroy-method="stop">
<property name="connectionFactory">
<bean
class="org.apache.activemq.ActiveMQConnectionFactory">
<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>
</bean>
</property>
</bean>
</property>
</bean>
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
<beans>
<!-- 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="http://activemq.org/config/1.0">
<!-- Use the following to set the broker memory limit
<memoryManager>
<usageManager id="memory-manager" limit="20 MB"/>
</memoryManager>
-->
<!-- Use the following to configure how ActiveMQ is exposed in JMX
<managementContext>
<managementContext connectorPort="1099" jmxDomainName="org.apache.activemq"/>
</managementContext>
-->
<persistenceAdapter>
<jdbcPersistenceAdapter dataSource="#mysql-ds"/>
</persistenceAdapter>
<transportConnectors>
<transportConnector name="openwire" uri="tcp://localhost:61616"/>
<transportConnector name="ssl" uri="ssl://localhost:61617"/>
<transportConnector name="stomp" uri="stomp://localhost:61613"/>
</transportConnectors>
<networkConnectors>
<!-- 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)" failover="true"/>
-->
</networkConnectors>
</broker>
<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=""/>
</bean>
</beans>
please suggest
> PooledConnectionFactory does not work with the
> org.springframework.jms.listener.DefaultMessageListenerContainer in the
> failure case
> -----------------------------------------------------------------------------------------------------------------------------------
>
> Key: AMQ-1045
> URL: https://issues.apache.org/activemq/browse/AMQ-1045
> 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.