activemq-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Gary Tully" <gary.tu...@gmail.com>
Subject Re: livelock AMQPersistenceAdapter
Date Fri, 16 Jan 2009 17:27:45 GMT
One thought, you have a boker bean and a factory using the vm protocol,
If the broker bean is not fully started before the connection factory,
you will have two brokers in the mix,

use    <property name="brokerURL"
value="vm://localhost?create=false&waitForStart=1000" />

so that the connection factory will not create a broker and will wait
till the broker bean is started,

There is also a depends-on bean attribute that you can use on the pool
to ensure that the broker is
started before the pool.

This should ensure there is a single broker in your context which
should shutdown when it is not referenced,

If the pool is holding on to references it may need an explicit
destroy method and or the broker may need an explicit stop destroy
method,

see the notes at the end of
http://activemq.apache.org/vm-transport-reference.html


2009/1/16 davis <davisford@gmail.com>:
>
> 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
>> (AMQPersistenceAdapter.java:1013) - 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>
>
> <bean id="myBeanDestination"
> class="org.apache.activemq.command.ActiveMQQueue">
>        <constructor-arg value="BEAN.QUEUE"/>
> </bean>
>
> <bean id="myBeanResponseDestination"
> class="org.apache.activemq.command.ActiveMQQueue">
>        <constructor-arg value="BEAN-RESPONSE.QUEUE"/>
> </bean>
>
> <!-- Pooled factory is recommended to avoid session per send -->
> <bean id="jmsFactory"
> class="org.apache.activemq.pool.PooledConnectionFactory"
> 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" />
>                </bean>
>        </property>
> </bean>
>
> <!-- Spring JMS transaction manager -->
> <bean id="jmsTransactionManager"
> class="org.springframework.jms.connection.JmsTransactionManager">
>        <property name="connectionFactory" ref="jmsFactory" />
> </bean>
>
> <!-- Spring JMS template -->
> <bean id="jmsTemplate" class="org.springframework.jms.core.JmsTemplate">
>        <property name="connectionFactory">
>                <ref local="jmsFactory"/>
>        </property>
> </bean>
>
> <!-- myBean sender-->
> <bean id="myBeanSender" class="com.example.MyBeanSender">
>        <property name="template" ref="jmsTemplate"/>
>        <property name="destination" ref="myBeanDestination"/>
> </bean>
>
> <!--  myBean Response Listener -->
> <bean id="myBeanResponseListener"
> class="com.example.MyBeanResponseListener"/>
>
> <!-- this auto-magically starts a listener for fax bean responses -->
> <bean
> class="org.springframework.jms.listener.DefaultMessageListenerContainer">
>        <property name="connectionFactory" ref="jmsFactory"/>
>        <property name="destination" ref="myBeanResponseDestination"/>
>        <property name="messageListener" ref="myBeanResponseListener"/>
>        <property name="transactionManager" ref="jmsTransactionManager"/>
> </bean>
> --
> View this message in context: http://www.nabble.com/livelock-AMQPersistenceAdapter-tp21418331p21503832.html
> Sent from the ActiveMQ - User mailing list archive at Nabble.com.
>
>



-- 
http://blog.garytully.com

Open Source SOA
http://FUSESource.com

Mime
View raw message