You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@qpid.apache.org by "zhaoyi0113@gmail.com" <zh...@gmail.com> on 2010/09/25 10:59:57 UTC

How can I use C++ client API for request-response message

I want to use C++ client API for request-response message. There is an
example in qpidc-6.0 but it uses a message listener for the response
message. What I want is looking for an API to block the current thread and
waiting for the response message. Does C++ client code support such API?
-- 
View this message in context: http://apache-qpid-users.2158936.n2.nabble.com/How-can-I-use-C-client-API-for-request-response-message-tp5569506p5569506.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


Re: How can I use C++ client API for request-response message

Posted by Gordon Sim <gs...@redhat.com>.
On 09/29/2010 08:53 AM, zhaoyi0113@gmail.com wrote:
>
> One more question. How can I give LocalQueue a uniq name? In above code, the
> LocalQueue name will be the session ID name. Does QPID client support
> generate a unique queue name?

No, not directly. You can use a UUID to create your own however, or 
since the session name is guaranteed to be unique use that as a basis.

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


Re: How can I use C++ client API for request-response message

Posted by "zhaoyi0113@gmail.com" <zh...@gmail.com>.
One more question. How can I give LocalQueue a uniq name? In above code, the
LocalQueue name will be the session ID name. Does QPID client support
generate a unique queue name?

thanks,

Zhao Yi
-- 
View this message in context: http://apache-qpid-users.2158936.n2.nabble.com/How-can-I-use-C-client-API-for-request-response-message-tp5569506p5582846.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


Re: How can I use C++ client API for request-response message

Posted by "zhaoyi0113@gmail.com" <zh...@gmail.com>.
Your code works very well. Thanks very much for your help.
-- 
View this message in context: http://apache-qpid-users.2158936.n2.nabble.com/How-can-I-use-C-client-API-for-request-response-message-tp5569506p5582337.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


Re: How can I use C++ client API for request-response message

Posted by Gordon Sim <gs...@redhat.com>.
On 09/26/2010 02:25 AM, zhaoyi0113@gmail.com wrote:
> I am using the qpid client API in my program.

WIth that API (and with 0.6 that is the recommended option), you could 
as Steve suggested use LocalQueue instead of MessageListener. See the 
attached simple example of the request-response pattern for how that 
might look.

> Do you have any method to
> convert the qpid client API to qpid message API? What I have in my program
> context is qpid:client:Session and if I use qpid messaging I have to use
> qpid:messaging:Session. Is there a way to convert qpid:client:Session to
> qpid:messaging:Session?

No, there is no way to convert between them. It is really an either/or 
decision. I would only recommend using the messaging API if you can 
update to trunk or wait until the next release (end of October) however. 
The 0.6 release did not have a fully implemented messaging API. If you 
do want to consider moving to that API at some point, have a read of 
http://qpid.apache.org/books/0.7/Programming-In-Apache-Qpid/html/ 
(refers to trunk code). There is also a client-server example available 
for that.

RE: How can I use C++ client API for request-response message

Posted by "zhaoyi0113@gmail.com" <zh...@gmail.com>.
I am using the qpid client API in my program. Do you have any method to
convert the qpid client API to qpid message API? What I have in my program
context is qpid:client:Session and if I use qpid messaging I have to use
qpid:messaging:Session. Is there a way to convert qpid:client:Session to
qpid:messaging:Session? 
-- 
View this message in context: http://apache-qpid-users.2158936.n2.nabble.com/How-can-I-use-C-client-API-for-request-response-message-tp5569506p5571138.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


RE: How can I use C++ client API for request-response message

Posted by Steve Huston <sh...@riverace.com>.
> I want to use C++ client API for request-response message. 
> There is an example in qpidc-6.0 but it uses a message 
> listener for the response message. What I want is looking for 
> an API to block the current thread and waiting for the 
> response message. Does C++ client code support such API?

You could use the qpid::client::LocalQueue, but I would recommend
instead using the qpid::messaging::Receiver class - you can block
waiting for a message.

-Steve

--
Steve Huston, Riverace Corporation
Total Lifecycle Support for Your Networked Applications
http://www.riverace.com


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