You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@qpid.apache.org by MartiN Beneš <ma...@gmail.com> on 2011/11/29 16:52:56 UTC

c++ qpid::client vs. qpid::messaging API

Hello,
I have a mess in the c++ APIs.
Is it correct, that the qpid::client is deprecated in favor of
qpid::messaging api?

If so, is there some equivalent of
qpid::client::MessageListener::received() function, which is being called
by the API on message arrival, or do i have to poll for the messages using
qpid::messaging::Receiver::fetch() , thus forcing me to create one thread
for every queue i am processing?

regards,
martin

Re: c++ qpid::client vs. qpid::messaging API

Posted by CLIVE <cl...@ckjltd.co.uk>.
Martin,

Don't forget to set the capacity on the receiver 
(receiver.setCapacity(50)) as the session.NextReceiver() method only 
works with pre-fetched messages.

This caught me out when I first started using session.NextReceiver().

Clive
> Yes, the qpid::client API has been deprecated and the qpid::messaging API is the preferred one to use going forward.
>
> You can use qpid::messaging::Session::nextReceiver() to handle receiving messages from multiple queues in a single thread.  nextReceiver() will return a Receiver that has available messages (if one exists).
>
> Andy
>
> On Nov 29, 2011, at 10:52 AM, MartiN Beneš wrote:
>
>> Hello,
>> I have a mess in the c++ APIs.
>> Is it correct, that the qpid::client is deprecated in favor of
>> qpid::messaging api?
>>
>> If so, is there some equivalent of
>> qpid::client::MessageListener::received() function, which is being called
>> by the API on message arrival, or do i have to poll for the messages using
>> qpid::messaging::Receiver::fetch() , thus forcing me to create one thread
>> for every queue i am processing?
>>
>> regards,
>> martin
>
> ---------------------------------------------------------------------
> 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


Re: c++ qpid::client vs. qpid::messaging API

Posted by Andy Goldstein <ag...@redhat.com>.
Yes, the qpid::client API has been deprecated and the qpid::messaging API is the preferred one to use going forward.

You can use qpid::messaging::Session::nextReceiver() to handle receiving messages from multiple queues in a single thread.  nextReceiver() will return a Receiver that has available messages (if one exists).

Andy

On Nov 29, 2011, at 10:52 AM, MartiN Beneš wrote:

> Hello,
> I have a mess in the c++ APIs.
> Is it correct, that the qpid::client is deprecated in favor of
> qpid::messaging api?
> 
> If so, is there some equivalent of
> qpid::client::MessageListener::received() function, which is being called
> by the API on message arrival, or do i have to poll for the messages using
> qpid::messaging::Receiver::fetch() , thus forcing me to create one thread
> for every queue i am processing?
> 
> regards,
> martin


---------------------------------------------------------------------
Apache Qpid - AMQP Messaging Implementation
Project:      http://qpid.apache.org
Use/Interact: mailto:users-subscribe@qpid.apache.org