On 08/25/2011 09:57 AM, tomas.sol...@deutsche-boerse.com 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:users-subscr...@qpid.apache.org