[rabbitmq-discuss] Metronome: How easy delivery messages from plugin?

Emile Joubert emile at rabbitmq.com
Mon Aug 6 10:07:02 BST 2012


Hi Vitali,

On 04/08/12 06:21, Vitali Makarov wrote:
> How I can easy get messages from channel or exchange into plugin?

The simplest way is to get messages is to use the Erlang direct client
and subscribe to a queue. See

http://www.rabbitmq.com/erlang-client-user-guide.html#receiving

> I looked through a bunch of sources, and anyway can not understand.
> Please show an example metronome.

The metronome is used as a "hello world" example that sends messages:

http://www.rabbitmq.com/plugin-development.html#plugin-hello-world
http://hg.rabbitmq.com/rabbitmq-metronome/

> For example:
> Metronome send messages in rabbit.
> Me need easy metronome receiver in second plugin.
> 
> name: rabbitmq-metronome-receiver
> desc: plugin get messages from metronome and write it in log 
> 
> rabbit_log:info("Metronome-receiver: routing_key: ~p, message: ~p~n",
> [RoutingKey,Message]),

If you want a record of all messages passing through the broker then
also look at the firehose tracer:

http://www.rabbitmq.com/firehose.html



-Emile



More information about the rabbitmq-discuss mailing list