[rabbitmq-discuss] recording all messages

Matthias Radestock matthias at rabbitmq.com
Sun Feb 20 11:50:14 GMT 2011

Jim, James,

James Carr wrote:
> On Fri, Feb 18, 2011 at 6:31 PM, Jim Irrer <irrer at umich.edu> wrote:
>> Is there a RabbitMQ plugin for recording all AMQP messages?  I was thinking
>> in terms of a development tool for diagnosing problems (knowing that it
>> would
>> be a huge drag on the system).
> I have actually been wondering the same thing. It'd be interesting to
> know if there is a way to implement an EIP style wiretap outside of
> just creating a queue for the routing key of the messages I want to
> watch.

I can think of at least five ways of doing that:

1) tap into the network stream with wireshark, which understands AMQP.

2) insert a logging AMQP proxy. Writing AMQP proxies is really quite 
straightforward. See, for example, rabbit's tracer 

3) Bind a logging queue to the various exchanges that messages get 
published to, with the same binding keys as the other queues in the 
system, and log messages from an AMQP client consuming from that queue. 
This only works for fairly static configurations, i.e. where the 
exchanges, queues and their bindings are known in advance. And it cannot 
log messages sent to the default exchange, since that does not permit 
explicit bindings.

4) As 3), but create fanout exchange intermediaries for all exchanges, 
bind the aforementioned logging queue to that and bind the real 
exchanges to the intermediaries with exchange-to-exchange bindings. The 
advantage over 3) is that the logging queue only needs one binding to 
each intermediate exchange. Hence this can cope with dynamic queue 
creation & binding. However, publishers will need modifying to publish 
to the intermediate exchanges.

5) write a rabbit plugin that taps into rabbit's internal message 
routing APIs using Erlang's tracing functionality.



More information about the rabbitmq-discuss mailing list