[rabbitmq-discuss] Publish to queue fails but publish to direct exchange works

Matthias Radestock matthias at rabbitmq.com
Sat Jun 19 06:44:44 BST 2010


Raphael Simon wrote:
> On Fri, Jun 18, 2010 at 12:07 AM, Matthias Radestock 
> <matthias at rabbitmq.com <mailto:matthias at rabbitmq.com>> wrote:
>     The reason we don't map the blank exchange name to something else is
>     that RabbitMQ permits anything in the exchange name, so *** and ---
>     actually are valid exchange names.
> I understand but it seems to me that the pain it causes users in general 
> is greater than the remote chance somebody would have called its queue 
> ---. Alternatively you could wrap queue names e.g. around brackets. You 
> could also use a divider ' | ' (which would also be an issue if somebody 
> called its queue ' | ' but again it seems to me that the benefits way 
> outweigh the drawbacks). 

We considered something like that, and early versions of the code worked 
that way, but it turned out to cause more problems than it solved.

The current output format is designed to be processed by standard tools 
in the unix tool chain, such as 'cut', which is a major advantage.

>         I should probably mention that sending the following queue.bind
>         packet didn't seem to help (rabbitmqctl list_bindings still
>         shows the
>         binding  missing).
>         [:sending,
>          #<AMQP::Protocol::Queue::Bind:0x9b26778
>          @arguments=nil,
>          @debug=1,
>          @exchange=
>         "nanite-rs-instance-fd0416fe31d7b019112c2c0adce9b4e4a261bab1-1094976",
>          @nowait=true,
>          @queue="nanite-rs-instance-fd0416fe31d7b019112c2c0adce9b4e4a261bab1-1094976",
>          @routing_key=nil,
>          @ticket=1>]
>     The exchange in the above should be blank.
> Setting the exchange to blank here did not seem to do the right thing. 
> The binding that is missing is the one from the queue name to the 
> routing key with the same name.

Ah, I didn't spot the second mistake - the routing key should be set to 
the queue name.

> Also a different issue: Using a blank string with rabbitmqctl 
> set_permissions has the same effect as using a wild card (.*). This 
> seems a little bit counter-intuitive (i.e. rabbitmqctl set_permissions 
> user "" "' "" has the same effect as rabbitmqctl set_permissions user 
> ".*" ".*" ".*").

We are implementing nothing special here; just following whatever the 
regexp library does.

One thing we could do is automatically anchor all regexp by surrounding 
them with ^$. That would make it impossible to use explicit anchors though.

> Finally a different question: is there a way to force a disconnect from 
> a client from the broker?

Yes, see the 'rabbitmqctl close_connection' command.



More information about the rabbitmq-discuss mailing list