[rabbitmq-discuss] Message returned as unroutable even if consumer is listening
Marek Majkowski
majek04 at gmail.com
Thu Mar 3 12:40:52 GMT 2011
On Wed, Mar 2, 2011 at 09:02, Jiri Krutil <jiri at krutil.com> wrote:
> We are seeing some strange behaviour consistently after installing the 2.3.1
> broker on a new linux box (which did not occur yet elsewhere).
>
> In our simple P2P setup, a client is sending messages to a server:
>
> CLIENT -> exchange "request.CLIENT" -> queue "request" -> SERVER
>
> We have two 2.3.1 Java client connections:
> - connection SERVER is consuming from queue "request"
> - connection CLIENT is sending messages to exchange "request.CLIENT" with
> routing key "request" with the immediate flag set
>
> The queue "request" is bound to direct exchange "request.CLIENT" using
> binding key "request".
>
> The problem is that all messages sent by CLIENT are returned by the broker
> as unroutable, even if we see a consumer listening on the target queue,
> which we believe is ready to consume messages.
You're doing something very wrong. Read this:
http://www.rabbitmq.com/amqp-0-9-1-reference.html#basic.publish
bit mandatory
This flag tells the server how to react if the message cannot be
routed to a queue. If this flag is set, the server will return an
unroutable message with a Return method. If this flag is zero, the
server silently drops the message.
bit immediate
This flag tells the server how to react if the message cannot be
routed to a queue consumer immediately. If this flag is set, the
server will return an undeliverable message with a Return method. If
this flag is zero, the server will queue the message, but with no
guarantee that it will ever be consumed.
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)
Cheers,
Marek
More information about the rabbitmq-discuss
mailing list