On 01/16/2014 02:07 PM, Xiong Zou wrote:
Hi Gordon,

Appreciate your help a lot!

To use the new qpid:messaging APIs, I can just replace qpid::client to
qpid:messaging in my source codes? I cannot find any pub-sub sample code for
new qpid:messaging APIs.

No, your code will require changes I'm afraid. The APIs are different. However the good news is that I believe you will find the qpid::messaging API much simpler.

For pub-sub in particular, there is little special code required. You can even use the drain and spout examples. See for example the section on 'Topics' in http://qpid.apache.org/releases/qpid-0.24/programming/book/section-addresses.html

As for the existing qpid::client APIs, I will test your suggestions and
update the result.

And I found some difficulty if I use m_subscriptions.run(). In this case I
will call m_subscriptions.cancel(m_vecQueueUIDs[i]); from a different
thread,

You are doing that anyway, since all start() does is tart a thread that calls run().

are these APIs of m_subscriptions thread safe? They seems not when I
check their source codes.

Yes, they should be threadsafe.

Or I have to send cancel subscription messages into receiver queues from
another thread, which is a bit troublesome with my current design.

Thanks & regards,
Xiong




--
View this message in context: 
http://qpid.2158936.n2.nabble.com/Client-warning-Session-was-not-closed-cleanly-tp7602834p7602853.html
Sent from the Apache Qpid users mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to