Return-Path: Delivered-To: apmail-qpid-users-archive@www.apache.org Received: (qmail 20571 invoked from network); 27 Oct 2009 01:25:58 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 27 Oct 2009 01:25:58 -0000 Received: (qmail 30502 invoked by uid 500); 27 Oct 2009 01:25:57 -0000 Delivered-To: apmail-qpid-users-archive@qpid.apache.org Received: (qmail 30465 invoked by uid 500); 27 Oct 2009 01:25:57 -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 30455 invoked by uid 99); 27 Oct 2009 01:25:57 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 27 Oct 2009 01:25:57 +0000 X-ASF-Spam-Status: No, hits=-10.6 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_HI X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of jbird@microsoft.com designates 131.107.115.214 as permitted sender) Received: from [131.107.115.214] (HELO smtp.microsoft.com) (131.107.115.214) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 27 Oct 2009 01:25:55 +0000 Received: from TK5EX14HUBC102.redmond.corp.microsoft.com (157.54.7.154) by TK5-EXGWY-E803.partners.extranet.microsoft.com (10.251.56.169) with Microsoft SMTP Server (TLS) id 8.2.176.0; Mon, 26 Oct 2009 18:25:45 -0700 Received: from TK5EX14MBXC141.redmond.corp.microsoft.com ([169.254.9.208]) by TK5EX14HUBC102.redmond.corp.microsoft.com ([157.54.7.154]) with mapi; Mon, 26 Oct 2009 18:25:32 -0700 From: James Birdsall To: "users@qpid.apache.org" Subject: RE: Last Value Queue LVQ using dotnet API / last value cache Thread-Topic: Last Value Queue LVQ using dotnet API / last value cache Thread-Index: AQHKVp7eIUtwyU5psEaHsfwOOLlIo5EYmpBQ Date: Tue, 27 Oct 2009 01:25:31 +0000 Message-ID: <5823B241362C1A418501F88C3F0DA900049BA5A5@TK5EX14MBXC141.redmond.corp.microsoft.com> References: <1256602282.55687.ezmlm@qpid.apache.org> In-Reply-To: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 I just had to figure this out myself. MessageAcquireMode.PRE_ACQUIRED is ex= actly what you DON'T want, because acquiring a message removes it from the = queue. NOT_ACQUIRED will leave it in the queue. -----Original Message----- From: Ignacio Ybarra [mailto:ignacio_ybarra@hotmail.com]=20 Sent: Monday, October 26, 2009 5:44 PM To: users@qpid.apache.org Subject: Last Value Queue LVQ using dotnet API / last value cache Hello,=20 =20 I have been trying to set up a Last Value Queue using your dotnet API (clie= nt0-10). Most of it works great -- apart from consuming messages without ta= king them from the queue (peek). Basically I want the consumer/listener to receive by not remove the msg fro= m the lvq, i.e. the setup to work as a last value cache. =20 Since I couldn't find parameters/methods to set this up using the interface= , I have taken the steps below. =20 The setup part of my code looks like this: =20 session.exchangeDeclare("ig.direct", "direct", null, null, new Option[] { O= ption.DURABLE }); session.queueDeclare("q1",null,new Dictionary(){{"qpid.last_= value_queue",1}}, new Option[] { Option.DURABLE }); session.exchangeBind("q1", "ig.direct", "routing_key"); The sender/publisher part of the code looks like this (in reality I send a = batch of msgs so they get overwritten): //List messages =3D new List() ; //for (int i =3D 0; i < Program.NUM_MSGS; i++) //{ IMessage message =3D new Message(); message.DeliveryProperties.setRoutingKey("routing_key"); message.DeliveryProperties.setDeliveryMode(MessageDeliveryMode.PERSISTENT); message.appendData(Encoding.UTF8.GetBytes("Message "));// + i)); message.ApplicationHeaders.Add("qpid.LVQ_key", "INTC"); //messages.Add(message) //} session.messageTransfer("ig.direct", message);//s[i]); =20 =20 The receiver/listener looks like this: =20 session.attachMessageListener(this, "q1"); session.messageSubscribe("q1"); //public void messageTransfer(IMessage m) //{ //... // Console.WriteLine("Message: " + message); //} All works with this setup, but the message is removed from the queue. =20 I have also tried the following in the listener, but in this case the callb= ack does not get any messages: =20 session.attachMessageListener(this, "myDest"); session.messageSubscribe("q1", "myDest", MessageAcceptMode.EXPLICIT, Messag= eAcquireMode.PRE_ACQUIRED, null, 0, null); =20 Any clues? Many thanks in advance.- ig =20 --------------------------------------------------------------------- Apache Qpid - AMQP Messaging Implementation Project: http://qpid.apache.org Use/Interact: mailto:users-subscribe@qpid.apache.org --------------------------------------------------------------------- Apache Qpid - AMQP Messaging Implementation Project: http://qpid.apache.org Use/Interact: mailto:users-subscribe@qpid.apache.org