Return-Path: Delivered-To: apmail-activemq-dev-archive@www.apache.org Received: (qmail 72952 invoked from network); 10 Jul 2008 04:53:39 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 10 Jul 2008 04:53:39 -0000 Received: (qmail 41270 invoked by uid 500); 10 Jul 2008 04:53:40 -0000 Delivered-To: apmail-activemq-dev-archive@activemq.apache.org Received: (qmail 41246 invoked by uid 500); 10 Jul 2008 04:53:40 -0000 Mailing-List: contact dev-help@activemq.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@activemq.apache.org Delivered-To: mailing list dev@activemq.apache.org Received: (qmail 41234 invoked by uid 99); 10 Jul 2008 04:53:39 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 09 Jul 2008 21:53:39 -0700 X-ASF-Spam-Status: No, hits=2.0 required=10.0 tests=HTML_MESSAGE,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: local policy includes SPF record at spf.trusted-forwarder.org) Received: from [203.84.221.17] (HELO web8808.mail.in.yahoo.com) (203.84.221.17) by apache.org (qpsmtpd/0.29) with SMTP; Thu, 10 Jul 2008 04:52:45 +0000 Received: (qmail 6921 invoked by uid 60001); 10 Jul 2008 04:52:03 -0000 DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.co.in; h=Received:X-Mailer:Date:From:Subject:To:MIME-Version:Content-Type:Message-ID; b=olA7e451SXRXKYzbNKGc8cIc8ME0LUJ5NOt/BjrARuowLOOOJX/RHsFJGxh35pFmCwn/ON2hvvNZmZjleHv5m+z2Y9FJnKhsmGKRMd8feAYOec5nWfBCEVEB6lnfWx7LVnrbeiCxtyQES6ekziDJvdoi3Fe+oG38tFdRYT2Y3TI=; Received: from [155.35.46.13] by web8808.mail.in.yahoo.com via HTTP; Thu, 10 Jul 2008 10:22:02 IST X-Mailer: YahooMailRC/975.45 YahooMailWebService/0.7.199 Date: Thu, 10 Jul 2008 10:22:02 +0530 (IST) From: Rakesh Kumar Subject: Fw: ActiveMQ message consumer not closing... To: ActiveMQ_Dev MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="0-1579867909-1215665522=:6698" Message-ID: <56038.6698.qm@web8808.mail.in.yahoo.com> X-Virus-Checked: Checked by ClamAV on apache.org --0-1579867909-1215665522=:6698 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Hi All,=0AI could not here anything about this issue that i am facing. can = anyone help me out here.=0A=0ARegards,=0ARakesh=0A----- Forwarded Message -= ---=0AFrom: Rakesh Kumar =0ATo: dev@activemq.apach= e.org=0ASent: Wednesday, 9 July, 2008 2:21:51 PM=0ASubject: ActiveMQ messag= e consumer not closing...=0A=0A=0AHi All,=0A=C2=A0=0AI have a created the= =C2=A0connection and consumers using ActiveMQ, and consumer is waiting for = the recive to complete. when we shutdown the application we close the conne= ction, but close call of connection does not notify all the consumers (who = is waiting for the message to be recived) after purging all the messages wh= ich is causing our application not to shutdown.=0Awe modified the close cal= l the notify all the consumers after purging all the unconsumed mesages and= so =0A=0AFollowing is the changes that i have made in ActiveMQConsumer.cpp= class (code block in blue)=0Avoid ActiveMQConsumer::close(){=0A....=0A=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 // Purge al= l the pending messages=0A=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0 try{=0A=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 purgeMessages();=0A=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 } catch ( ActiveMQEx= ception& ex ){=0A=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 if( !haveException ){=0A=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0 ex.setMark( __FILE__, __LINE__ );=0A=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0 error =3D ex;=0A=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0 haveException =3D true;=0A=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 }=0A=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 }=0A=0A=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0synchronized( &unconsumedMessages )=0A= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 {=0A=C2=A0=C2=A0=C2=A0 =C2= =A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0=C2=A0unconsumedMessag= es.notifyAll();=0A=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0}= =0A...=0A}=0A=0Acan anyone let me know why this has not been done?=0A=C2=A0= =0AThanks for the reply in advance...=0A=C2=A0=0ARegards,=0ARakesh=0Aconsum= er->receive() call is able to come out of the wait and shutdown of applicat= ion happens properly=0A=0A=0A Explore your hobbies and interests. Go t= o http://in.promos.yahoo.com/groups/ --0-1579867909-1215665522=:6698--