Reported by pehughes (1262046077|%O ago)
A queue is bound to a topic exchange with a wildcard, prior to a topic being created. Subsequently another queue binds to the topic exchange without a wildcard. Publishing to the topic generates a hit only on the non-wildcard binding. If the binding order is reversed (i.e. the wildcard binding occurs after the topic is created), the message is routed to both queues as expected. Is this behavior correct?
Here is a simple test that routes a message to two queues bound to a topic exhange. Only one queue receives the message
<?xml?> <pal script="amq_pal_gen"> <session> <exchange_declare exchange="worker.topic" type="topic" /> <queue_declare queue="auto.0" /> <queue_bind queue="auto.0" exchange="worker.topic" routing_key="m.*" /> <queue_declare queue="auto.1" /> <queue_bind queue="auto.1" exchange="worker.topic" routing_key="m.r" /> <basic_content message_id="this message should arrive twice" /> <basic_publish exchange="worker.topic" routing_key="m.r" /> <set name="count" value="0" /> <repeat times="10"> <basic_get queue="auto.0" /> <basic_arrived> <echo>$message_id</echo> <inc name="count" /> </basic_arrived> <basic_get queue="auto.1" /> <basic_arrived> <echo>$message_id</echo> <inc name="count" /> </basic_arrived> <if name = "count" value = "2"> <exit/> </if> <wait timeout="500" /> </repeat> </session> </pal>
Tests were compiled and run on Fedora 11. I tested against Fedora 11 OpenAMQ/1.3d0 and Windows XP OpenAMQ/1.4c0 brokers.
Two pal scripts are inlcuded: pass_test and fail_test. Note that if you run pass_test then fail_test, without restarting the broker in between, fail_test fails to fail.
|File name||File type||Size|
|fail_test.pal||XML document text||929 Bytes||Info|
|pass_test.pal||XML document text||929 Bytes||Info|