Return-Path: Delivered-To: apmail-qpid-users-archive@www.apache.org Received: (qmail 85073 invoked from network); 2 Jun 2010 15:04:11 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 2 Jun 2010 15:04:11 -0000 Received: (qmail 63932 invoked by uid 500); 2 Jun 2010 15:04:11 -0000 Delivered-To: apmail-qpid-users-archive@qpid.apache.org Received: (qmail 63893 invoked by uid 500); 2 Jun 2010 15:04:10 -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 63885 invoked by uid 99); 2 Jun 2010 15:04:10 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 02 Jun 2010 15:04:10 +0000 X-ASF-Spam-Status: No, hits=-5.5 required=10.0 tests=AWL,RCVD_IN_DNSWL_HI,SPF_HELO_PASS,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of aconway@redhat.com designates 209.132.183.28 as permitted sender) Received: from [209.132.183.28] (HELO mx1.redhat.com) (209.132.183.28) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 02 Jun 2010 15:04:05 +0000 Received: from int-mx05.intmail.prod.int.phx2.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.18]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id o52F3gEF003151 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Wed, 2 Jun 2010 11:03:43 -0400 Received: from [10.11.10.31] (vpn-10-31.rdu.redhat.com [10.11.10.31]) by int-mx05.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id o52F3f5W030107; Wed, 2 Jun 2010 11:03:41 -0400 Message-ID: <4C0672CD.9040400@redhat.com> Date: Wed, 02 Jun 2010 11:03:41 -0400 From: Alan Conway Organization: Red Hat User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.9) Gecko/20100430 Fedora/3.0.4-2.fc12 Lightning/1.0b2pre Thunderbird/3.0.4 MIME-Version: 1.0 To: users@qpid.apache.org CC: "usman.ch" Subject: Re: Blocking request call using request-response_client example References: <1275456272411-5129336.post@n2.nabble.com> In-Reply-To: <1275456272411-5129336.post@n2.nabble.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Scanned-By: MIMEDefang 2.67 on 10.5.11.18 On 06/02/2010 01:24 AM, usman.ch wrote: > > Based on the request/response client and server examples , I want to > modify the client in way that it send a request and wait for the reply > before sending next request. Want to implement blocking mechanism. > subscriptions.run(); blocks for the entire subscription and calling > subscription.stop() in received() method of the listner to resume the main > application results in queue deletion. Could anyone please guide me in this > regard as what function should I call to make client blocking till it > received the response from server. > If you're using the new messaging API, which is recommended if you're using the latest version, there is a synchronous request/respose example in qpid/cpp/examples/messaging/client.cpp. If you're stuck on the old API you can create a client::LocalQueue and subscribe that instead of a MessageListener. The LocalQueue has methods for getting messages one at a time from the queue. --------------------------------------------------------------------- Apache Qpid - AMQP Messaging Implementation Project: http://qpid.apache.org Use/Interact: mailto:users-subscribe@qpid.apache.org