GS.Chandra N wrote:
Hi,

I have just started with the client api's using python pub-sub examples. I'm
modifying them for my purpose / for understanding and have encountered some
doubts. I would appreciate any help with these


1. Is a new delivery_property objected created each time
session.delivery_properties is called or are we getting only a reference to
a session global delivery property object? How do i set multiple multiple
delivery_properties to the same message?

Each call creates a new and independent delivery_properties object.

You can set multiple properties by specifying them in the factory method:

dp = session.delivery_properties(delivery_mode=..., priority=...)

You can also just set them directly on the object returned by the delivery_properties factory method:

dp = session.delivery_properties()
dp.delivery_mode=...
dp.priority=...

2. None of the examples show how i can add other message headers. Can i use
session.delivery_properties("my_field"=val) for this purpose?

You can't add top level properties to delivery_properties or message_properties, but one of the message properties is a free-form map you can use like this:

mp = session.message_properties(application_headers={"my_field": val, ...})

2. Are there any naming / file conventions to track down the relevant C++
api from the python api apart from a grep?

There aren't any conventions per/se (at least not intentional ones ;), however the examples implement the same functionality in each language, so you could cross compare if you want to get an idea of how to port something from C++ to python or vice versa.

4.is there any api that creates a new queue and connects directly to the
destination without this being explictly handled in the code?

What exactly do you mean by connect? Publish? Subscribe? Bind?

If you provide an example snippet of code I can probably tell you if there's a simpler way to do it.

5.i want to measure the latencies and delivery rates etc at both the python
client and the brokers - how do i do this?

I believe there is a qpid-queue-stats command that will report things like the enqueue/dequeue statistics on the console. For the client end you'd have to track your own statistics.

--Rafael


---------------------------------------------------------------------
Apache Qpid - AMQP Messaging Implementation
Project:      http://qpid.apache.org
Use/Interact: mailto:[email protected]

Reply via email to