Return-Path: X-Original-To: apmail-activemq-users-archive@www.apache.org Delivered-To: apmail-activemq-users-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 4005676B7 for ; Wed, 31 Aug 2011 15:00:44 +0000 (UTC) Received: (qmail 33193 invoked by uid 500); 31 Aug 2011 15:00:43 -0000 Delivered-To: apmail-activemq-users-archive@activemq.apache.org Received: (qmail 33136 invoked by uid 500); 31 Aug 2011 15:00:43 -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 33128 invoked by uid 99); 31 Aug 2011 15:00:43 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 31 Aug 2011 15:00:43 +0000 X-ASF-Spam-Status: No, hits=0.6 required=5.0 tests=FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,SPF_PASS,T_TO_NO_BRKTS_FREEMAIL,URI_HEX X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of gary.tully@gmail.com designates 209.85.216.178 as permitted sender) Received: from [209.85.216.178] (HELO mail-qy0-f178.google.com) (209.85.216.178) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 31 Aug 2011 15:00:37 +0000 Received: by qyk30 with SMTP id 30so526996qyk.2 for ; Wed, 31 Aug 2011 08:00:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; bh=Nvpv5ifLl24E1NFalPNAyf0oaI060kSBtopZBZrrc28=; b=QBZthkO1qXeNtx6p3mFHgfgesPr2YuCaWc96L0ORerSJ3GP0ODCJL4mrLKXlgqB03k r961XneHoP//RG0gxDpiqN7OnbNzw1etnW/r4F3ypOgI/15E0Kopukxvk6UPlk/8xuJq ZRi7YV4kwTkD1a2idPvE/Lw7wuO8IusCbS+dM= MIME-Version: 1.0 Received: by 10.229.2.23 with SMTP id 23mr345867qch.253.1314802816444; Wed, 31 Aug 2011 08:00:16 -0700 (PDT) Received: by 10.229.232.195 with HTTP; Wed, 31 Aug 2011 08:00:16 -0700 (PDT) In-Reply-To: <1314714642131-3778860.post@n4.nabble.com> References: <1314714642131-3778860.post@n4.nabble.com> Date: Wed, 31 Aug 2011 16:00:16 +0100 Message-ID: Subject: Re: To pick pending messages, consumer should just unsubscribe/subscribe or completely disconnect/connect from broker From: Gary Tully To: users@activemq.apache.org Content-Type: text/plain; charset=ISO-8859-1 X-Virus-Checked: Checked by ClamAV on apache.org There is no correct way, both are correct. Calling close() to unsubscribe and session.addConsumer() to subscribe again is the most efficient... but if you can detect the hang and again return from your listener or call receive() again that will also suffice. When you say hang, what component blocks and why? On 30 August 2011 15:30, manua wrote: > HI, > > I have activemq setup with a consumer on a queue. > If the consumer hangs, there are pending messages in the queue. > > To consume those messages, I restart the consumer. > > To restart should I just unsubscribe/subscribe to the queue or should I > completely disconnect from the broker and reconnect. > > What is the correct way to do this. > > Thanks > Manu > > -- > View this message in context: http://activemq.2283324.n4.nabble.com/To-pick-pending-messages-consumer-should-just-unsubscribe-subscribe-or-completely-disconnect-connectr-tp3778860p3778860.html > Sent from the ActiveMQ - User mailing list archive at Nabble.com. > -- http://fusesource.com http://blog.garytully.com