You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@qpid.apache.org by To...@deutsche-boerse.com on 2011/08/10 15:41:52 UTC

C++ client - Address translation

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?

Thanks,

Tomas



----------------------------------------------------------------------------
Deutsche Börse Services s.r.o.
Managing Directors/Geschäftsführung:
Michael Gassmann, Mats Andersson.
Limited liability company with registered office at
Sokolovská 662/136B, CZ-186 00 Prague 8
recorded in the Commercial Register IC: 275 77 015.
Maintained by the city court in Prague,
Sec. C, File No. 116874.
-----------------------------------------
Diese E-Mail enthaelt vertrauliche oder rechtlich geschuetzte Informationen.
Wenn Sie nicht der beabsichtigte Empfaenger sind, informieren Sie bitte
sofort den Absender und loeschen Sie diese E-Mail. Das unbefugte Kopieren
dieser E-Mail oder die unbefugte Weitergabe der enthaltenen Informationen
ist nicht gestattet.

The information contained in this message is confidential or protected by
law. If you are not the intended recipient, please contact the sender and
delete this message. Any unauthorised copying of this message or
unauthorised distribution of the information contained herein is prohibited.

Legally required information for business correspondence/
Gesetzliche Pflichtangaben fuer Geschaeftskorrespondenz:
http://deutsche-boerse.com/letterhead

Re: C++ client - Address translation

Posted by Gordon Sim <gs...@redhat.com>.
On 08/10/2011 02:41 PM, Tomas.Soltys@deutsche-boerse.com 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:users-subscribe@qpid.apache.org