On 08/10/2011 02:41 PM, [email protected] wrote:
Hi all,

I have a following problem when witing a qpid client in C++

I am trying to setup a receiver on this address:
"response/response.hey_Joe; { create: never, link: { name:
'response.hey_Joe', durable: false, x-declare: { auto-delete: true,
exclusive: true, arguments: { 'qpid.max_count': 1000, 'qpid.max_size':
1000000, 'qpid.policy_type': ring } }, x-bindings: [ { exchange:
'response', key: 'response.hey_Joe' } ] } }"

If using client written in python addres is translated correctly, but in
C++ client the first slash '/' is replaced with underscore '_'.

So instead of "response/response.hey_Joe" my C++ client contacts broker
and tries to declare queue with folowing name "response_response.hey_Joe"

Can someone explain me why my C++ and Python clients are behaving
differently? Am I missing something?

The difference is in how the two clients construct the name for the subscription queue that is bound into the response exchange. The python client uses the name option in the link on its own; the c++ client appends that name to the name of the exchange, separated by an underscore. (The fact that your subject and name here are the same is a co-incidence, they need not be and the queue name follows the name option not the subject).

The primary purpose of the name option was in identifying a link so that you could reconnect and resubscribe to the same queue. I.e. to allow for links that logically at least survived a loss of connection. I mention this only because by specifying auto-delete, the queue will be deleted when the connection is lost, so will be recreated every time.

The clients should behave the same way though for consistency. I'd be happy to fix that if you want to raise a JIRA.

Also might be worth pointing out that the x-bindings element you have there is actually redundant. The presence of the subject will automatically create the same binding.

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

Reply via email to