From users-return-1929-apmail-qpid-users-archive=qpid.apache.org@qpid.apache.org Thu Sep 17 21:20:41 2009 Return-Path: Delivered-To: apmail-qpid-users-archive@www.apache.org Received: (qmail 87147 invoked from network); 17 Sep 2009 21:20:41 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 17 Sep 2009 21:20:41 -0000 Received: (qmail 90490 invoked by uid 500); 17 Sep 2009 21:20:41 -0000 Delivered-To: apmail-qpid-users-archive@qpid.apache.org Received: (qmail 90473 invoked by uid 500); 17 Sep 2009 21:20:41 -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 90463 invoked by uid 99); 17 Sep 2009 21:20:40 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 17 Sep 2009 21:20:40 +0000 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_HELO_PASS,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of lists+1231964187411-2158936@n2.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; Thu, 17 Sep 2009 21:20:32 +0000 Received: from tervel.nabble.com ([192.168.236.150]) by kuber.nabble.com with esmtp (Exim 4.63) (envelope-from ) id 1MoOOh-0000pz-59 for users@qpid.apache.org; Thu, 17 Sep 2009 14:20:11 -0700 Date: Thu, 17 Sep 2009 14:20:11 -0700 (PDT) From: Azim Fatehi To: users@qpid.apache.org Message-ID: <1253222411150-3665147.post@n2.nabble.com> In-Reply-To: <4AB091EF.8090605@redhat.com> References: <1253056547125-3652616.post@n2.nabble.com> <4AB091EF.8090605@redhat.com> Subject: Re: C# queue autodelete problem MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Nabble-From: axf222@gmail.com X-Virus-Checked: Checked by ClamAV on apache.org Thanks for the tip, Gordon. After turning tracing on it seemed like the queues were being declared with the correct options and the session was detached properly. But comparing the traces to ones collected with a C++ program, we found that the C++ client library seems to implicitly do an executionSync() after queueDeclare() which the C# library doesn't do. After modifying the C# program to explicitly sync the session after calling queueDeclare(), everything works properly and the queues are cleaned up when the client terminates. Gordon Sim wrote: > > On 09/16/2009 12:15 AM, res wrote: >> >> Hi All, >> I'm having some trouble with queue auto-delete in the C# client. I have >> created a queue with Option.AUTO_DELETE set, but when my client >> terminates >> it doesn't delete the queue within the broker. Has anyone else run in to >> this? Doing basically the same thing in C++ works fine. > > Turn on logging for the broker (e.g. specify --log-enable > trace+:amqp_0_10 --log-to-file qpidd.log to qpidd) and then run the code > below against that. > > You should then see the queue declare request as seen by the broker in > the log and can check that the flags set are as expected, and also that > the session is detached and the client closed as expected. > > >> My code looks like this: >> >> Here is the code for subscription: >> _client.connect(host, port, "test", "guest", "guest"); >> _clientSession = _client.createSession(50000); >> prepareQueue(qpidQueue, routingKey, _clientSession, inputQueue); >> >> private void prepareQueue(string queue, string routing_key, >> ClientSession session , InputQueue inputQueue) >> { >> // Create a unique queue name for this consumer by >> concatenating >> // the queue name parameter with the Session ID. >> string queueName = queue + ":" + CustomRegistrationID; >> session.queueDeclare(queueName, Option.EXCLUSIVE, >> Option.AUTO_DELETE); >> >> // Route messages to the new queue if they match the routing >> key. >> session.exchangeBind(queueName, "amq.topic", routing_key); >> >> // subscribe the listener to the queue >> IMessageListener listener = new MessageListener(this, >> session, >> inputQueue); >> session.attachMessageListener(listener, queueName); >> session.messageSubscribe(queueName); >> session.messageFlow(queueName, MessageCreditUnit.MESSAGE, >> -1); >> } >> >> Here is the code for unsubscribe: >> _clientSession.close(); >> _client.close(); >> >> > > > --------------------------------------------------------------------- > Apache Qpid - AMQP Messaging Implementation > Project: http://qpid.apache.org > Use/Interact: mailto:users-subscribe@qpid.apache.org > > > -- View this message in context: http://n2.nabble.com/C-queue-autodelete-problem-tp3652616p3665147.html Sent from the Apache Qpid users mailing list archive at Nabble.com. --------------------------------------------------------------------- Apache Qpid - AMQP Messaging Implementation Project: http://qpid.apache.org Use/Interact: mailto:users-subscribe@qpid.apache.org