[rabbitmq-discuss] Exposing rabbit management via AMQP

Ben Hood 0x6e6562 at gmail.com
Sat Oct 27 22:05:27 BST 2007


Hi,

Recently on this list there was a question about using access controls
in rabbit, so I've added a first cut of exposing the rabbit management
API via AMQP using the Erlang direct client.

This is intended to be an AMQP alternative to the rabbitmqctl script
and is not my idea, I stole it from Tony.

On the client side it consists of calling the rabbit_access_control
module via RPC over AMQP.

I used Hessian to encode the functions, arguments and replies, but the
mechanism is not necessarily tied to this.

On the server side, it consists of firing up an RPC handler that is
*parameterized* with the rabbit_access_control module.

To test this, you need to:

1. Make sure the 0.1.3 release of the Erlang hessian library
(http://cotton.sourceforge.net/) is in your OTP path as well as the
amqp_erlang library
(http://dev.rabbitmq.com/viewmtn/branch/changes/com.rabbitmq.erlang-client).

2. Fire up the rabbit server and run the rpc handler in the same VM as
the server, e.g.:

erl -mnesia dir WHEREEVER -boot start_sasl -s rabbit

3. Boot the RPC handler:

1> direct_integration_test:start_rabbit_management().

4. Run the test from a different Erlang VM:

1> network_integration_test:rabbit_management_test().

That's it.

As this is only a POC, there are limitations and considerations at the
moment which include:

- I haven't tested every exported function in the
rabbit_access_control control module yet.
- The RPC handler could be registered with the rabbit supervisor so
that you don't have to start it explicitly.
- This piggybacks off an RpcClient pattern that is implemented in the
Erlang client, which is still experimental and may change.
- I haven't tested it with the Java client yet.

amongst others.

Any input, feedback or discussion is appreciated.

Ben




More information about the rabbitmq-discuss mailing list