[rabbitmq-discuss] Message returned as unroutable even if consumer is listening

Marek Majkowski majek04 at gmail.com
Thu Mar 3 13:10:56 GMT 2011


On Thu, Mar 3, 2011 at 12:55, Jiri Krutil <jiri at krutil.com> wrote:
> Marek,
>
>> As you can see immediate->"undelivered", mandatory->"unroutable".
>>
>> You can try using rabbitmq-management plugin to debug if your
>> exchanges/bindings/queues are configured properly.
>> (you may also try rabbitmqctl, but it's harder to use)
>
> Thanks for your response. I think that our configuration is correct.
>
> The thing we don't understand is that our messages are being returned by the
> broker because of "no consumers", even if we can see a consumer listening
> (both via rabbitmqctl and the management plugin).
>
> In all other environments this design seems to work fine. We are trying to
> find out what is wrong with the single broker installation that does not
> want to accept any messages.

Okay. You're probably using basic.qos and/or acknowledgments.

'Immediate' is interpreted by rabbit as follows:
 - pick up a consumer from 'free' consumers list
 - deliver message.

If no consumer is 'free' rabbit will return the message.

The problem is when a consumer is treated as 'free'.

The consumer is always 'free' if it's not using acknowledgments.
In such case rabbit will just push all the messages to it.
(well, it's more complicated, rabbit may still dislike the
consumer if the network connection is too slow)

If consumer is using acks _and_ is not acking messages
fast enough - rabbit will have to queue the messages.
The queue size will grow and rabbit will not be able
to 'immediately' deliver messages.

If you set basic.qos(N) - rabbit will move the consumer
off the 'free' list if the consumer has N unacknowledged
messages.
If you don't set basic.qos, I think rabbit will deliver
100 messages before moving the consumer off the 'free' state.

Is your consumer fast enough?

Cheers,
  Marek


More information about the rabbitmq-discuss mailing list