You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@activemq.apache.org by Vibe from Boston <dj...@yahoo.com> on 2010/04/18 02:08:36 UTC

Active MQ Lingering threads

I have very simple app that publishes to a specific queue. everything works
fine but the app after completing everything wont exit because of lingering
ActiveMQ threads. It comes out of main() method but still is running.
I used YourKit profile to check and I see quite a few threads spawned by Q.
Is there anyway i can get hold of the executor from which the threads have
been spawned, so i can shut them down.

Spring file
<code>
	<amq:connectionFactory id="amqConnectionFactory"
brokerURL="tcp://192.168.0.106:61616" userName="system" password="manager"
/>
	
	<bean id="connectionFactory"
class="org.springframework.jms.connection.CachingConnectionFactory">		
		<property name="targetConnectionFactory" ref="amqConnectionFactory" />
		<property name="exceptionListener" ref="jmsExceptionListener" />
		<property name="sessionCacheSize" value="100" />
	</bean>

</code>
I see all these threads in waiting state. InactivityMonitor Async Task
[quite a few of these], ActiveMQ Scheduler [i would imagine this is the root
thread], InactivityMonitor ReadCheck/WriteCheck, xloTimer,
xDispatcherSrvxxx.





-- 
View this message in context: http://old.nabble.com/Active-MQ-Lingering-threads-tp28279636p28279636.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.


Re: Active MQ Lingering threads

Posted by Vibe from Boston <dj...@yahoo.com>.


Vibe from Boston wrote:
> 
> I have very simple app that publishes to a specific queue. everything
> works fine but the app after completing everything wont exit because of
> lingering ActiveMQ threads. It comes out of main() method but still is
> running.
> I used YourKit profile to check and I see quite a few threads spawned by
> Q. Is there anyway i can get hold of the executor from which the threads
> have been spawned, so i can shut them down.
> 
> Spring file
> <code>
> 	<amq:connectionFactory id="amqConnectionFactory"
> brokerURL="tcp://192.168.0.106:61616" userName="system" password="manager"
> />
> 	
> 	<bean id="connectionFactory"
> class="org.springframework.jms.connection.CachingConnectionFactory">		
> 		<property name="targetConnectionFactory" ref="amqConnectionFactory" />
> 		<property name="exceptionListener" ref="jmsExceptionListener" />
> 		<property name="sessionCacheSize" value="100" />
> 	</bean>
> 
> </code>
> I see all these threads in waiting state. InactivityMonitor Async Task
> [quite a few of these], ActiveMQ Scheduler [i would imagine this is the
> root thread], InactivityMonitor ReadCheck/WriteCheck, xloTimer,
> xDispatcherSrvxxx.
> 
> 
> 
> 
> 
> 


i found the solution. you need to cast your ApplicationContext class to
AbstractApplicationContext

ApplicationContext context= new
ClassPathXmlApplicationContext("classpath:appContext.xml");
    	
//do everything here        
        ((AbstractApplicationContext) context).close();
-- 
View this message in context: http://old.nabble.com/Active-MQ-Lingering-threads-tp28279636p28282630.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.