My apologies if this is me totally failing to grok how this works...

A little more experimenting (this was done using the Fedora 16 packages):

qpid-config add queue doppleganger
qpid-config add exchange topic doppleganger

(in either order of execution) creates a queue *and* an exchange, both with
the name 'doppleganger'. Attempts to interact with them through addressing
will resolve to the queue only, regardless of the order of creation (tested
by using assert).

I would expect the second call to fail with an error "Object already
exists".

On the other hand:

spout 'uniqueindividual; {create:always, node:{type:topic}}'
spout 'uniqueindividual; {create:always, node:{type:queue}}'

(in either order of execution) creates only one object (whichever one you
put first). The second call will then route to the existing object.

That it doesn't create a second object with the same name seems more
intuitive than the behavior of qpid-config. However, I half-expected that
specifying a node type for create would imply assert if an object with that
name already exists.


On Tue, Jul 17, 2012 at 10:02 AM, Sitapati das / Joshua J Wulf <
[email protected]> 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?
>
>  - Josh
>

Reply via email to