On 07/17/2012 01:02 AM, Sitapati das / Joshua J Wulf wrote:
I'm working through the Address tutorial here:
http://qpid.apache.org/books/0.16/Programming-In-Apache-Qpid/html/section-addresses.html
I was not expecting this behaviour:
$ spout 'amq.topic; {assert: always, node: { type: topic}}' test-message
Message(properties={'spout-id': 'ea2e7b50-4153-4d4e-8323-ca9b95e18ab4:0'},
content='test-message')
$ qpid-config add queue amq.topic
$ spout 'amq.topic; {assert: always, node: { type: topic}}' test-message
Traceback (most recent call last):
File "/usr/share/doc/python-qpid-0.16/examples/api/spout", line 101, in
<module>
snd = ssn.sender(addr)
File "<string>", line 6, in sender
File "/usr/lib/python2.7/site-packages/qpid/messaging/endpoints.py", line
595, in sender
raise e
qpid.messaging.exceptions.AssertionFailed: expected topic, got queue
I expected the attempt to create a queue with the same name as an existing
exchange to fail; however, it looks like queues and exchanges can be
created with the same name.
I tested a few combinations, and when a queue and an exchange with the same
name are created, the queue always takes precedence, regardless of the
order of creation.
I was hoping that using assert would disambiguate the intended destination
of my message. Since multiple objects with the same name can be created, is
there a way to specify what class of target I mean by a name?
In the python client, it appears there is not (Rafi?). In the c++
client, you use the node type for that. So e.g.
spout 'amq.topic; {node: {type:topic}}'
will send to the exchange, whereas
spout 'amq.topic; {node: {type:queue}}'
will send to the queue.
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@qpid.apache.org
For additional commands, e-mail: users-h...@qpid.apache.org