[rabbitmq-discuss] debugging an unroutable message

Matthew Sackman matthew at lshift.net
Tue Mar 30 11:59:37 BST 2010

On Tue, Mar 30, 2010 at 06:44:32AM -0400, Daniel Risacher wrote:
> I did have some race conditions in the first pass of the code, but I
> think that's fixed before I wrote to the list.  Generating the 'ping'
> happens as part of a $queue->do_when_created() callback.  I'm
> certainly not explicitly changing the ack settings or QoS settings.

Ok, so you are manually acking the messages on both the daemon and the
client? It shouldn't be causing the issue you're seeing, but it's still
good to always let RabbitMQ know when you've received the message.

> I actually fixed my example by not binding the reply queue to
> amq.direct, and instead using the default binding to the unnamed
> default exchange.  Which is good in that I can move forward on other
> parts of my project, but one of the secondary goals of the project is
> to learn about how AMQP works in implementation, and I still don't
> understand what was wrong with the first approach.
> I never delete queues - I let the server do that when the connection drops.

Ok, so you're either setting them exclusive or auto-delete?

> I suppose there could be another race between the bind to amq.direct
> and the pong.  I wasn't explicitly waiting for bindOK, although as I
> recall from the traces, I was getting bindOK, before sending the ping,
> and it still wasn't working - but I'll check that.

Sure, in general, any command that has an _ok variant should be treated
as synchronous and you should wait for the reply before continuing
(unless you have good reason not to, but bears await ye).

> Are there rules about what can be bound to amq.direct?


> It would be useful if there were some way to have rabbitmq output
> every transaction (in commit order?) for analysis/debugging. Is there
> any mechanism to do something like that?  Maybe as a plugin?

Yes, use the Tracer which is part of the Java client. This sits in the
middle of a connection and just dumps out (after decoding) every message
that flies in either direction.


More information about the rabbitmq-discuss mailing list