activemq-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From vadimos <>
Subject sends/receives block during failover
Date Wed, 10 Sep 2008 17:27:56 GMT


I am starting two brokers (tcp://localhost:61616 and tcp://localhost:61626)
with shared FS. One is locked out because journal is locked by the master as
it should be. Then I start my Spring base web app with a TransportListener
added to ActiveMQConnectionFactory. When spring is done with initialization,
I see TransportListener.onCommand() being called continuously.

Now, I kill master broker and notice TransportListener.transportInterupted()
called and a slave broker coming alive by obtaining access to the journal.
Once that happens TransportListener.transportResumed() is called and several
TransportListener.onCommand() calls are made.

Then, everything stops! No more TransportListener.onCommand() calls and if I
submit a new message, I can see it pending in the queue according to jmx but
it is never picked up until I restart my application. 
There is the following note in the doc: "If you use failover, and broker
dies at some point, your sends will block. Using TransportListener can help
with this regard." 

I this note related to the issue I am observing? if yes, how how should I
use TransportListener within spring container to "reset" things and what
exactly do I need to reset (sharedConnection, maybe)? If the problem is
within spring, why TransportListener.onCommand() is no longer called?

As you can see I am not sure where the issue is but my goal is not to have
to restart my app after broker failover.


Here is my setup:

<bean id="activeMQConnectionFactory"
	<property name="brokerURL"
	<property name="redeliveryPolicy" ref="jmsRedeliveryPolicy"/>
	<property name="prefetchPolicy" ref="jmsPrefetchPolicy"/>
	<property name="copyMessageOnSend" value="false"/>
	<property name="transportListener">
		<bean class="com.adobe.jms.ActiveMQTransportListener"/>

<bean id="activeMQPooledConnectionFactory"
	<property name="connectionFactory" ref="activeMQConnectionFactory"/>

<bean id="defaultJmsTemplate"
    <property name="connectionFactory">
        <property name="targetConnectionFactory">
          <ref local="activeMQPooledConnectionFactory" />

<bean id="abstractConvertListenerContainer" 
	<property name="connectionFactory" ref="activeMQConnectionFactory" />
	<property name="destination" ref="convertDestination" />
	<property name="messageListener" ref="convertMessageListener" />
	<property name="sessionTransacted" value="true"/>
	<property name="cacheLevelName" value="CACHE_CONSUMER" />
	<property name="exceptionListener" ref="jmsExceptionListener" />

View this message in context:
Sent from the ActiveMQ - User mailing list archive at

View raw message