[rabbitmq-discuss] clarifying plugin supervision, configuration

Simon MacMullen simon at rabbitmq.com
Thu Sep 2 15:34:08 BST 2010


Hi Jon. I don't know if you've found answers to these questions yet, but 
I'll take a stab at answering anyway.

On 24/08/10 17:11, Jon Brisbin wrote:
> I'm looking at some of the existing plugins and I just want to make sure
> I understand how the plugins are supervised in the broker.
>
> It looks like it starts the application defined in the plugin's .app
> file, whose start() function should call my plugin's supervisor's
> start_link() function, correct?

Yes. It can start more than one supervisor of course, but it needs to 
return the pid of the top-level one.

> Looking at rabbit_shovel, the plugin loads the configuration in the
> start_link() function, which I assume is coming from the main
> rabbit.config file? I don't have to have a separate config file for my
> plugin, correct?

Yes.

> I'll need to listen on multiple exchanges, so I'm assuming I'll need a
> gen_server, which starts separate consumers, for each configuration
> element (akin to what rabbit_shovel is doing by creating a child
> configuration in the supervisor for each element in the configuration
> file). How far can I go before I need to worry about resource usage of
> the "process per consumer" approach?

Pretty far. Erlang processes are in general much cheaper than threads 
are in other languages precisely so you can do things like that.

Cheers, Simon

> Or should I have a consumer that
> listens to multiple exchanges (since it'll be doing almost the same
> thing for every message that comes through)?
>
> Thanks!
>
> J. Brisbin
> http://jbrisbin.com/
>
>
>
>
>
>
>
>
> _______________________________________________
> rabbitmq-discuss mailing list
> rabbitmq-discuss at lists.rabbitmq.com
> https://lists.rabbitmq.com/cgi-bin/mailman/listinfo/rabbitmq-discuss


-- 
Simon MacMullen
Staff Engineer, RabbitMQ
SpringSource, a division of VMware



More information about the rabbitmq-discuss mailing list