You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@activemq.apache.org by Mykola <mp...@gmail.com> on 2007/09/25 17:38:26 UTC

Message Queue get stuck with 2 consumers connected to it

Hi all
I'm using network of brokers config with 2 brokers
After some time one of the queues on one broker stopped dispatching messages
to its 2 consumers, log files contained no errors and any kind of strange
behavior, 3 other queues on the same broker were just fine

my config file for brokers is as simple as following

<beans>
<bean
class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer"/>
<broker brokerName="sonoportal-amq" useJmx="true"
xmlns="http://activemq.org/config/1.0"
dataDirectory="${activemq.base}/data">
<managementContext>
        <managementContext connectorPort="1100"
jmxDomainName="org.apache.activemq" />
</managementContext>
<transportConnectors>
        <transportConnector name="openwire"
uri="tcp://amq01-qa.dc.sonopia.com:61616" />
</transportConnectors>
<networkConnectors>
        <networkConnector uri="static:(tcp://amq02-qa.dc.sonopia.com:61616)"
networkTTL='5' dynamicOnly='true'/>
</networkConnectors>
</broker>
</beans>

And symmetric one for second broker

Listeners are configured with Spring and has a following configuration

    <bean id="mailJmsListenerContainer"
class="org.springframework.jms.listener.SimpleMessageListenerContainer">
        <property name="concurrentConsumers" value="2" />
        <property name="connectionFactory" ref="jmsConnectionFactory" />
        <property name="destination" ref="mailJmsDestination" />
        <property name="messageListener">
        	 <ref bean="mailJmsListener"/>
        </property>
        <property name="sessionTransacted" value="true"></property>
    </bean>

Connection Factory is 

	<bean id="jmsConnectionFactory"
		class="org.apache.activemq.pool.PooledConnectionFactory"
		init-method="start" destroy-method="stop" depends-on="jmsBroker">
		<property name="connectionFactory">
			<bean
				class="org.apache.activemq.ActiveMQConnectionFactory">
				<property name="brokerURL"			
value="failover:(tcp://amq01-qa.dc.sonopia.com:61616,tcp://amq02-qa.dc.sonopia.com:61616)"
/>
				<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>
	<!-- JMS queue for sending Mail -->
	<bean id="mailJmsDestination"
		class="org.apache.activemq.command.ActiveMQQueue">
		<constructor-arg>
			<value>QUEUE.MAIL</value>
		</constructor-arg>
	</bean>


I monitored the Brocker with JMX and get the increasing queue size. What is
the problem here? Why messages get stuck in the Queue.
I'm using 4.1.1 version with Spring 2.0.5

Interesting thing that after restarting of the server, messages get
consumed, so I assume the problem might be in listeners. One more
interesting bug is that after they get consumed QueueSize attribute became
negative, how this can be possible, I assume that it get calculated as
EnqueueCount - DequeueCount, which is not correct if broker get restarted

Thanks in advance for any help
-- 
View this message in context: http://www.nabble.com/Message-Queue-get-stuck-with-2-consumers-connected-to-it-tf4516386s2354.html#a12882306
Sent from the ActiveMQ - User mailing list archive at Nabble.com.