activemq-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From davis <>
Subject Re: livelock AMQPersistenceAdapter
Date Fri, 16 Jan 2009 17:01:06 GMT

This list seems a tad dead.  Is there any reason traffic is extremely low and
many queries go unanswered?  Just curious.  

I've ignored this problem for now, but now it really is annoying, and I must
fix it.  If I run a complete suite of unit tests, somewhere along the line
the AMQPersistenceAdapter#stop() method is not getting called, and later the
AMQPersistenceAdapter#start() is getting called, which causes the whole test
suite to hang on the lock file.

davis wrote:
> 11:36:14,511 WARN  [32788514@qtp0-4] amq.AMQPersistenceAdapter
> ( - Waiting to Lock the Store
> activemq\data

I have tried to follow the recommend practices for managing AMQ with spring. 
I start an embedded broker, and this is how I do it (below).  I put a
destroy-method="stop" on the PooledConnectionFactory.  This does not seem to
be cleaning up things the way they should be.  How can I tie in the
AMQPersistenceAdapter#stop() method -- which is really Service#stop() into
Spring, so the whole thing shuts down gracefully?  

Thank you in advance for your help.

<bean id="broker" class="org.apache.activemq.xbean.BrokerFactoryBean">
    	<property name="config" value="classpath:activemq.xml" />
    	<property name="start" value="true" />

<bean id="myBeanDestination"
    	<constructor-arg value="BEAN.QUEUE"/>
<bean id="myBeanResponseDestination"
  	<constructor-arg value="BEAN-RESPONSE.QUEUE"/>

<!-- Pooled factory is recommended to avoid session per send -->
<bean id="jmsFactory"
destroy-method="stop" init-method="start">
	<property name="connectionFactory">
		<bean class="org.apache.activemq.ActiveMQConnectionFactory">
			<!-- use local VM URL for efficiency -->
			<property name="brokerURL" value="vm://localhost" />
<!-- Spring JMS transaction manager -->
<bean id="jmsTransactionManager"
	<property name="connectionFactory" ref="jmsFactory" />
<!-- Spring JMS template -->
<bean id="jmsTemplate" class="org.springframework.jms.core.JmsTemplate">
	<property name="connectionFactory">
		<ref local="jmsFactory"/>
<!-- myBean sender-->
<bean id="myBeanSender" class="com.example.MyBeanSender">
	<property name="template" ref="jmsTemplate"/>
	<property name="destination" ref="myBeanDestination"/>
<!--  myBean Response Listener -->
<bean id="myBeanResponseListener"
<!-- this auto-magically starts a listener for fax bean responses -->
	<property name="connectionFactory" ref="jmsFactory"/>
	<property name="destination" ref="myBeanResponseDestination"/>
	<property name="messageListener" ref="myBeanResponseListener"/>
	<property name="transactionManager" ref="jmsTransactionManager"/>
View this message in context:
Sent from the ActiveMQ - User mailing list archive at

View raw message