You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@activemq.apache.org by Terry K <ty...@thomson.com> on 2007/11/20 18:04:43 UTC

JMS dies after main thread exits

Hi,


In Java when the main thread exits, all remaining working threads should
continue. I have created Threads where messages are received and processed
and committed. I expected my spawned threads to continue processing messages
well after the main thread exits - they die mysteriously after the main
thread exits.

I use the main thread to create all the JMS objects e.g. Session,
Destination, MessageConsumer etc. Then they are passed into the object that
runs in the spawned threads. 

If I put the main thread to sleep for any period the threads consume
messages until the main thread exits.

I want the main thread to exit with the spawned ones continuing until a
message recieved on a topic queue executes the onMessage () method and stops
the spawned threads before doing some work.

If anyone can help I'd be very pleased to hear what is really going on here

-- 
View this message in context: http://www.nabble.com/JMS-dies-after-main-thread-exits-tf4844687s2354.html#a13860934
Sent from the ActiveMQ - User mailing list archive at Nabble.com.