[rabbitmq-discuss] Strange RabbitMQ management plugin error!

Simon MacMullen simon at rabbitmq.com
Wed Jan 12 15:21:00 GMT 2011


On 11/01/11 18:48, Ciprian Dorin Craciun wrote:
>      I don't see any errors displayed from the management plugin. It
> just says that it started the web server, serving the usual URL.
>      I've also tried to set both the `force_fine_statistics` and
> `collect_statistics` but they don't seem to have any effect.

I had a play with your run_rabbit script and I found the problem.

RabbitMQ has the concept of a boot step - part of the startup process of 
the rabbit application. These are the things like

"starting xyz                                          ...done"

that appear on stdout during startup.

Some plugins, including rabbit_management_agent need to insert boot 
steps into the rabbit app (as well as being their own apps). 
rabbit_management_agent does this in order to collect the statistics 
it's asked for.

The way this works is that when rabbit starts up it looks for boot steps 
in all *loaded* applications. Our boot script loads all applications, 
then starts them. So you need to as well:

~~~~
-module (run_rabbit).

-export ([run/0]).

run () ->
     Apps1 = [sasl, os_mon, mnesia, inets, crypto, mochiweb,
              rabbit_mochiweb],
     Apps2 = [rabbit, amqp_client, rabbit_management_agent, webmachine,
              rabbit_management],

     [ok = application:load(A) || A <- Apps1 ++ Apps2],

     [ok = application:start(A, permanent) || A <- Apps1],
     ok = rabbit:prepare(),
     [ok = application:start(A, permanent) || A <- Apps2],

     ok = timer:sleep(120 * 1000),
     ok = init:stop(),
     ok.
~~~~

>> Also, why have you done this? What problem is it solving?
>>
>> Cheers, Simon
>
>      Good question. :) We'll I'm trying to "embed" RabbitMQ into
> another Erlang application -- a web server that instead of handling
> the requests it just puts them on a queue, and waits for the response
> (the same pattern as in the rpc module is doing). I intend to use
> `amqp_client` in with the `direct` connector. I've seen that there is
> a similar project but for SMTP -- `rabbitmq-smtp`.

I think rabbitmq-smtp is just a regular plugin. You might want to 
consider doing the same thing - turning things inside out so that your 
web server is running as a RabbitMQ plugin. This is more or less exactly 
what the management plugin does.

Or you can continue on your current path, but the extent to which we 
don't support running RabbitMQ this way is quite high :)

Cheers, Simon

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



More information about the rabbitmq-discuss mailing list