activemq-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Dave Song <>
Subject Messages are blocked in queue when using JDBC Master/Slave
Date Fri, 14 Dec 2007 11:23:05 GMT


I have a question when using JDBC Master/Slave. Some of the messages that
have sent to queue are not consumed by messageListener

I used ActiveMQ with spring. It worked perfect with one broker. the beans
configuration is like:

	<bean id="twoBrokersTestJmsTemplate"
		<property name="defaultDestinationName"
			value="ActiveMQ.In.twoBrokersTest" />
		<property name="connectionFactory">
			<ref bean="twoBrokersTestJmsFactory" />

	<bean id="twoBrokersTestJmsFactory"
		<property name="connectionFactory">
				 <property name="brokerURL"

	<bean name="twoBrokersTestQueueListener"

	<bean id="twoBrokersTestQueueListenerContainer"
		<property name="concurrentConsumers" value="5" />
		<property name="connectionFactory" ref="twoBrokersTestJmsFactory" />
		<property name="destinationName" value="ActiveMQ.In.twoBrokersTest" />
		<property name="messageListener" ref="twoBrokersTestQueueListener" />
		<property name="sessionAcknowledgeModeName"
		<property name="sessionTransacted" value="true" />

To made it work more reliable, i tried to use JDBC Master/Slave cluster. I
changed the brokerURL to:


And start two brokers in different PC. I configurate both of the
activemq.xml to use the jdbcPersistenceAdapter, like below:

		<jdbcPersistenceAdapter dataSource="#mssql-ds" useDatabaseLock="false"/>

The DB I used is SQLServer 2000. So I have to set useDatabaseLock to false
or else there will be an exception.

Then I sent some messages to queue with an interval. the problem is some of
the messages would not be consumed by the
messageListenr(twoBrokersTestQueueListener) if the interval is more than 30
seconds. That is to say, it work fine if i sent the messages every 20 (or
any interval <= 29) seconds.

The only related constant I konw whose default value is set to 30 seconds is
"MaxInactivityDuration". I have tried to configurate
"wireFormat.maxInactivityDuration=0" in both client and broker to disable
it. However, I didn't work.

It is very strange that “interval” makes the listeners not working as

Any help/suggestions would be appreciated

Thank you in advance, 

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

View raw message