Question About Bindings

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

Question About Bindings

Alvaro Videla-2
Hi,

I have a question regarding how bindings work.

I have a brand new build of RabbitMQ, started with make run

I noticed that after I do the usual calls (pseudocode):

access_request("/")
queue_declare("queue_name")
exchange_declare("exchange_name")
queue_bind("queue_name", "exchange_name")
basic_consume("consumer_tag")

and then in Erlang I do the following:

> Bindings = rpc:call('rabbit@localhost', rabbit_exchange, list_bindings, [<<"/">>]).

I get this list:

[{{resource,<<"/">>,exchange,<<>>}, {resource,<<"/">>,queue,<<"bounce_mail">>}, <<"bounce_mail">>,[]},
 {{resource,<<"/">>,exchange,<<"bounce_mail_router">>},  {resource,<<"/">>,queue,<<"bounce_mail">>},  <<>>,[]}]

What are those anonymous exchanges?, like the one from the list head?

Regards,

Alvaro



_______________________________________________
rabbitmq-discuss mailing list
[hidden email]
http://lists.rabbitmq.com/cgi-bin/mailman/listinfo/rabbitmq-discuss
Reply | Threaded
Open this post in threaded view
|

Re: Question About Bindings

Tony Garnock-Jones-2
Alvaro Videla wrote:
> What are those anonymous exchanges?, like the one from the list head?

It's the binding to the AMQP "default exchange". Every queue is automatically
given a binding to a direct exchange named "" in AMQP 0-8 and 0-9-1. It sorta
kinda permits delivering messages directly to queues, but I'd still recommend
explicitly managing your own bindings rather than relying on this default
binding behaviour.

Regards,
  Tony


_______________________________________________
rabbitmq-discuss mailing list
[hidden email]
http://lists.rabbitmq.com/cgi-bin/mailman/listinfo/rabbitmq-discuss
Reply | Threaded
Open this post in threaded view
|

Re: Question About Bindings

Matthias Radestock-3
Alvaro,

Tony Garnock-Jones wrote:
> Alvaro Videla wrote:
>> What are those anonymous exchanges?, like the one from the list head?
>
> It's the binding to the AMQP "default exchange". Every queue is
> automatically given a binding to a direct exchange named "" in AMQP
> 0-8 and 0-9-1. It sorta kinda permits delivering messages directly to
> queues, but I'd still recommend explicitly managing your own bindings
> rather than relying on this default binding behaviour.

I disagree with Tony here. But he knows that ;)

Relying on the default exchange bindings is perfectly fine. They are in
every 0-* AMQP spec and are widely supported by brokers. By contrast,
attempting to manage these bindings (i.e. bindings to the default
exchange) explicitly is prohibited by some versions of the spec and thus
not guaranteed to work.

Regards,

Matthias.

_______________________________________________
rabbitmq-discuss mailing list
[hidden email]
http://lists.rabbitmq.com/cgi-bin/mailman/listinfo/rabbitmq-discuss
Reply | Threaded
Open this post in threaded view
|

Re: Question About Bindings

Alvaro Videla-2
Thanks to both you.

I needed to have that clear, since I'm writing an admin tool for RabbitMQ and I was seeing those blank exchanges popping up.

Alvaro

On Apr 23, 2010, at 2:44 PM, Matthias Radestock wrote:

> Alvaro,
>
> Tony Garnock-Jones wrote:
>> Alvaro Videla wrote:
>>> What are those anonymous exchanges?, like the one from the list head?
>> It's the binding to the AMQP "default exchange". Every queue is
>> automatically given a binding to a direct exchange named "" in AMQP
>> 0-8 and 0-9-1. It sorta kinda permits delivering messages directly to
>> queues, but I'd still recommend explicitly managing your own bindings
>> rather than relying on this default binding behaviour.
>
> I disagree with Tony here. But he knows that ;)
>
> Relying on the default exchange bindings is perfectly fine. They are in every 0-* AMQP spec and are widely supported by brokers. By contrast, attempting to manage these bindings (i.e. bindings to the default exchange) explicitly is prohibited by some versions of the spec and thus not guaranteed to work.
>
> Regards,
>
> Matthias.


_______________________________________________
rabbitmq-discuss mailing list
[hidden email]
http://lists.rabbitmq.com/cgi-bin/mailman/listinfo/rabbitmq-discuss
Reply | Threaded
Open this post in threaded view
|

Re: Question About Bindings

Tony Garnock-Jones-2
In reply to this post by Matthias Radestock-3
Matthias Radestock wrote:
> I disagree with Tony here. But he knows that ;)

Well, to clarify, I meant more something along the lines of "avoid using the
default exchange, use your own exchanges instead". But yes, with current
releases, if you limit yourself to only ever mentioning the default exchange in
basic.publish operations, and otherwise relying on the standardised behaviour
for the default exchange, you're definitely safe.

Tony


_______________________________________________
rabbitmq-discuss mailing list
[hidden email]
http://lists.rabbitmq.com/cgi-bin/mailman/listinfo/rabbitmq-discuss