activemq-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Terry K <>
Subject JMS dies after main thread exits
Date Tue, 20 Nov 2007 17:04:43 GMT


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:
Sent from the ActiveMQ - User mailing list archive at

View raw message