Return-Path: Delivered-To: apmail-activemq-users-archive@www.apache.org Received: (qmail 70442 invoked from network); 20 Nov 2007 17:05:15 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 20 Nov 2007 17:05:15 -0000 Received: (qmail 83870 invoked by uid 500); 20 Nov 2007 17:05:01 -0000 Delivered-To: apmail-activemq-users-archive@activemq.apache.org Received: (qmail 83706 invoked by uid 500); 20 Nov 2007 17:05:01 -0000 Mailing-List: contact users-help@activemq.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: users@activemq.apache.org Delivered-To: mailing list users@activemq.apache.org Received: (qmail 83697 invoked by uid 99); 20 Nov 2007 17:05:01 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 20 Nov 2007 09:05:01 -0800 X-ASF-Spam-Status: No, hits=2.6 required=10.0 tests=DNS_FROM_OPENWHOIS,SPF_HELO_PASS,SPF_PASS,WHOIS_MYPRIVREG X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of lists@nabble.com designates 216.139.236.158 as permitted sender) Received: from [216.139.236.158] (HELO kuber.nabble.com) (216.139.236.158) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 20 Nov 2007 17:04:49 +0000 Received: from isper.nabble.com ([192.168.236.156]) by kuber.nabble.com with esmtp (Exim 4.63) (envelope-from ) id 1IuWWh-0005Sh-EW for users@activemq.apache.org; Tue, 20 Nov 2007 09:04:43 -0800 Message-ID: <13860934.post@talk.nabble.com> Date: Tue, 20 Nov 2007 09:04:43 -0800 (PST) From: Terry K To: users@activemq.apache.org Subject: JMS dies after main thread exits MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Nabble-From: tyrone.king@thomson.com X-Virus-Checked: Checked by ClamAV on apache.org 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.