From users-return-1832-apmail-qpid-users-archive=qpid.apache.org@qpid.apache.org Mon Aug 31 17:26:32 2009 Return-Path: Delivered-To: apmail-qpid-users-archive@www.apache.org Received: (qmail 35139 invoked from network); 31 Aug 2009 17:26:32 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 31 Aug 2009 17:26:32 -0000 Received: (qmail 39341 invoked by uid 500); 31 Aug 2009 17:26:31 -0000 Delivered-To: apmail-qpid-users-archive@qpid.apache.org Received: (qmail 39329 invoked by uid 500); 31 Aug 2009 17:26:31 -0000 Mailing-List: contact users-help@qpid.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: users@qpid.apache.org Delivered-To: mailing list users@qpid.apache.org Received: (qmail 39319 invoked by uid 99); 31 Aug 2009 17:26:31 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 31 Aug 2009 17:26:31 +0000 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=FM_FAKE_HELO_VERIZON,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of jason-jones@verizon.net designates 206.46.173.11 as permitted sender) Received: from [206.46.173.11] (HELO vms173011pub.verizon.net) (206.46.173.11) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 31 Aug 2009 17:26:21 +0000 Received: from [192.168.1.4] ([173.74.172.170]) by vms173011.mailsrvcs.net (Sun Java(tm) System Messaging Server 6.3-7.04 (built Sep 26 2008; 32bit)) with ESMTPA id <0KP900CC94F1S6N1@vms173011.mailsrvcs.net> for users@qpid.apache.org; Mon, 31 Aug 2009 12:25:49 -0500 (CDT) Message-id: <4A9C079D.2030907@verizon.net> Date: Mon, 31 Aug 2009 12:25:49 -0500 From: Jason Jones User-Agent: Thunderbird 2.0.0.23 (Windows/20090812) MIME-version: 1.0 To: users@qpid.apache.org Subject: Re: Processing then acknowledging message from broker. References: <4A9BFB44.2080809@verizon.net> <4A9C0547.7040704@redhat.com> In-reply-to: <4A9C0547.7040704@redhat.com> Content-type: text/plain; charset=ISO-8859-1; format=flowed Content-transfer-encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org John thanks for replying. I am using the C++ QPID client library. I am using the SubscriptionManager and MessageListener classes to receive a message. So are you saying that when the method MessageListener::received() is called the message is received, but still on the queue in the broker, then after MessageListener::received() returns the message is acknowledged and removed from the queue? Thanks, Jason Jones John Dennis wrote: > On 08/31/2009 12:33 PM, Jason Jones wrote: >> Hello, >> >> >> I am interested in writing a message consumer that cannot tolerate >> message loss. In the event that the message consumer crashes while >> processing a message I want the consumer to be able to restart and >> process the same message that it was working on when it crashed. I am >> assuming that it is possible to receive a message, while leaving on the >> broker, then process it, and then acknowledge to the broker that the >> message was processed thus removing it from the queue. Can someone >> explain and provide an example of how to receive a message from the >> broker, then process the message, and then acknowledge the message? If >> it doesn't work this way can you explain to me then how to implement >> this functionality? > > This is how AMQP clients already work. You read a message and then you > "accept" the message after having fully processed it. When you accept > the message you're telling the broker you're done with it. > > You didn't say which language you're using, the symbol names are > slightly different, but you'll want to look for "accept" in the symbol > name. In C++ look for accept(), acceptMode, getUnaccepted(), etc. Also > checkout acquireMode and acquire*, they may also be of use to you. > > > --------------------------------------------------------------------- Apache Qpid - AMQP Messaging Implementation Project: http://qpid.apache.org Use/Interact: mailto:users-subscribe@qpid.apache.org