Hi Gordon,

Thank you for your reply.
But there is still one thing I do not understand.

I have set the log level to trace+ on my broker and here is what I got 
from the log when I have used the same same addres for python as well as 
for c++ client.

Python:

2011-08-26 12:13:08 trace 
[email protected]:0: recv cmd 0: 
{ExchangeQueryBody: name=response; }
2011-08-26 12:13:08 trace 
[email protected]:0: recv cmd 1: 
{QueueQueryBody: queue=response; }
2011-08-26 12:13:08 trace 
[email protected]:0: recv cmd 2: 
{QueueDeclareBody: queue=response.QPID_CLIENT.response_queue_1; 
exclusive=1; auto-delete=1; 
arguments={qpid.max_count:F8:int64(1000),qpid.max_size:F8:int64(1000000),qpid.policy_type:V2:4:str16(ring)};
 
}
2011-08-26 12:13:08 trace 
[email protected]:0: recv cmd 3: 
{ExchangeBindBody: queue=response.QPID_CLIENT.response_queue_1; 
exchange=response; binding-key=response.QPID_CLIENT.response_queue_1; }
2011-08-26 12:13:08 trace 
[email protected]:0: recv cmd 4: 
{MessageSubscribeBody: queue=response.QPID_CLIENT.response_queue_1; 
destination=0; accept-mode=0; acquire-mode=0; }
2011-08-26 12:13:08 trace 
[email protected]:0: recv cmd 5: 
{MessageSetFlowModeBody: destination=0; flow-mode=0; }
2011-08-26 12:13:08 trace 
[email protected]:0: recv cmd 6: 
{MessageCancelBody: destination=0; }
2011-08-26 12:13:08 trace 
[email protected]:0: recv cmd 7: 
{QueueDeleteBody: queue=response.QPID_CLIENT.response_queue_1; }

C++:

2011-08-26 12:15:48 trace 
[email protected]: recv cmd 0: 
{ExecutionSyncBody: }
2011-08-26 12:15:48 trace 
[email protected]: recv cmd 1: 
{ExchangeQueryBody: name=response; }
2011-08-26 12:15:48 trace 
[email protected]: recv cmd 2: 
{ExchangeDeclareBody: exchange=response; type=topic; alternate-exchange=; 
arguments={}; }

C++ client will get 'ACL denied exchange declare request from 
QPID_CLIENT@QPID9999' from the broker. So to make the C++ client to be 
able to pass through I had to adapt the ACL rules and change the adress as 
stated in my previous email.

Thanks and regards,
Tomas




Gordon Sim <[email protected]> 
25/08/2011 14:27
Please respond to
[email protected]


To
[email protected]
cc

Subject
Re: C++ and Python client diferences







On 08/25/2011 09:57 AM, [email protected] wrote:
> Hi,
>
> I am using qpid 13.0 API (from apache SVN) to build my C++ client and I
> have came across this interesting difference when compared to Python
> client.
>
> So for Python I am using this address:
>
> response/response.QPID_CLIENT.response_queue_1;
> {
>    create: receiver,
>    link:
>    {
>      name: 'response.QPID_CLIENT.response_queue_1',
>      durable: false,
>      x-declare:
>      {
>        auto-delete: true,
>        exclusive: true,
>        arguments:
>        {
>          'qpid.max_count': 1000,
>          'qpid.max_size': 1000000,
>          'qpid.policy_type': ring
>        }
>      }
>    }
> }
>
>
> But for C++ client the address had to be modified to:
>
> response/response.QPID_CLIENT.response_queue_1;
> {
>    assert: never,
>    create: never,
>    node :
>    {
>      type: topic
>    },
>    link:
>    {
>      name: 'response.QPID_CLIENT.response_queue_1',
>      durable: false,
>      x-declare:
>      {
>        auto-delete: true,
>        exclusive: true,
>        arguments:
>        {
>          'qpid.max_count': 1000,
>          'qpid.max_size': 1000000,
>          'qpid.policy_type': ring
>        }
>      }
>    }
> }
>
>
> And I had to add two ACL rules:
>
> acl allow members create exchange name=response passive=true
> acl allow QPID_CLIENT@QPID9999 create  queue name=response.QPID_CLIENT.*
> passive=true
>
>
> Can someone please explain me this difference? Is this expected 
behavior?

I may be missing the difference you are talking about with addressing. I 
believe both of those addresses works the same with each client, though 
the two addresses may do different things.

The key differences in the two are that the second one specifies the 
node type and that the second one does not create the node on demand. 
This will be relevant only when there is no exchange or queue named 
'response'. In this case, both with the python and c++ client, if the 
node is created on first use it will be a queue by default unless you 
specify the node type in which case an exchange will be created.

So if there is an exchange named response, then the two addresses will 
be equivalent. If there is no such exchange (or queue), the first 
address will result in a *queue* named response being created and the 
second will result in a not-found exception.

As to the ACL rules, the c++ client will issue a passive declare when 
creating a sender or receiver for the exchange response. That is why the 
first rule is required. The python client does not do that. We should 
align the steps between the two to make creating ACLs more uniform.

The second rule would be required for using a pre-existing queue whose 
name starts with 'response.QPID_CLIENT'. E.g. were you to remove the 
node type from the second address and run the c++ client with that 
modified address after having first run the python client with the first 
address.

I hope this helps to clarify what you are seeing. If there is some 
difference or unexpected behaviour I have missed please let me know.

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






----------------------------------------------------------------------------
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

Reply via email to