[rabbitmq-discuss] fanout queue not working

Steve Powell steve at rabbitmq.com
Fri Mar 30 13:56:27 BST 2012


Dear octo,

Trying to understand what queues and bindings you may have created I
reformatted the list_bindings output you sent:

Listing bindings ...
        exchange    log2_consumer       queue   log2_consumer       []
        exchange    rawlogs_consumer    queue   rawlogs_consumer        []
rawlogs exchange    log2_consumer       queue           []
rawlogs exchange    rawlogs_consumer    queue   logstash        []
...done.

The first column is the exchange name, followed by 'exchange', then the
destination (queue) name, followed by 'queue' then the routing key, and
lastly any arguments on the binding (you have none []).

So what appears is that you have

* bound log2_consumer to the default (blank) exchange (with the routing
  key set to the name of the queue -- which is normal for a direct
  exchange, which the default exchange is);

* bound rawlogs_consumer similarly;

These two are default bindings created whenever you create a queue.

Then again you have two (explicit) bindings which you have no-doubt
created yourself:

* bound log2_consumer to the rawlogs exchange, with a blank ("") routing
  key

* bound rawlogs_consumer to the rawlogs exchange with the logstash key.

If rawlogs is a fanout exchange then if you publish a message to that
exchange, both of these queues should get a copy of the message
(regardless of what routing key you supply on the publish -- and
regardless of the routing key used to bind the queue to the fanout
exchange).

So, the obvious question is 'how did you publish those messages'?
Supplementary: 'what do you mean "connect fine" to the queue'?

I can guess that if you publish to the default exchange ("") with
routing key "rawlogs_consumer" you would see what you say you see, but I
can't think how else you might see it. Certainly, if you publish to the
"rawlogs" exchange I would expect the message to appear on both queues.

Steve Powell
steve at rabbitmq.com
[wrk: +44-2380-111-528] [mob: +44-7815-838-558]

On 30 Mar 2012, at 01:26, octomeow wrote:

> newbie to rabbitmq  and I'm not getting messages into a certain queue
> 
> I have a simple fanout exchange
> # rabbitmqctl list_exchanges
> rawlogs fanout
> 
> I have bound this exchange to a few queues
> # rabbitmqctl list_bindings
> Listing bindings ...
>        exchange        log2_consumer       queue
> log2_consumer       []
>        exchange        rawlogs_consumer        queue
> rawlogs_consumer        []
> rawlogs exchange        log2_consumer       queue           []
> rawlogs exchange        rawlogs_consumer        queue
> logstash        []
> ...done.
> 
> I connect fine to the log2_consumer queue....however, I get NO
> messages.
> 
> my other queue..... the rawlogs_consumer does the the messges
> _______________________________________________
> rabbitmq-discuss mailing list
> rabbitmq-discuss at lists.rabbitmq.com
> https://lists.rabbitmq.com/cgi-bin/mailman/listinfo/rabbitmq-discuss



More information about the rabbitmq-discuss mailing list