[rabbitmq-discuss] RabbitMQ erlang client documentation

Sylvain Hellegouarch sh at defuze.org
Thu Dec 3 08:21:29 GMT 2009


Hi there,

I've been using for the past few months the erlang client lib but I hadn't
updated for a while and it seems things have quite changed since
September. For the best I'm sure.

However, I find a little tedious to work with the library as it critically
lack any sort of documentation.

For instance the test suite seems to suggest one should be using
amqp_connection:start(Params) to create a new connection but, unless I'm
mistaken, that function doesn't exist and you must use directly either
start_network or start_direct.

Also, it's unclear whether or not you can safely reuse Connections across
several erlang nodes concurrently or if there are some issues in doing so.
Can I use one connection and cretae as many channels as I want? Should
channel be on a per erlang process basis?

Another blurry point is whether or not one can use amqp_channel_util
functions or if they are rather internals to the lib. If the former, how
to use them the best?

My use case is probably common:

I have a gen_server where I direct all my AMQP calls (publish, etc.) and
within that gen_server I create a pool of connections. Should this pool
reside in its own gen_server so that each connection belongs to one single
supervised erlang process? Currently I keep the pool within the
gen_server's state. But this means I'm concurrently using the same
connection for different channels. Is that safe?

To be honest, I would be more than happy if the lib could come with its
own pool so that I'm sure I'm not doing something stupid.

In any case, a bit more info about dos and donts would be quite
appreciated :)

Cheers,
- Sylvain
-- 
Sylvain Hellegouarch
http://www.defuze.org




More information about the rabbitmq-discuss mailing list