[rabbitmq-discuss] RabbitMQ erlang client documentation

Vlad Alexandru Ionescu vlad at lshift.net
Fri Dec 4 17:49:13 GMT 2009


Sylvain,

> Anyway, currently I have one single connection and I'm opening a channel
> for each HTTP request, publishing and immediatly closing that channel. Is
> that the most efficient usage of the erlang lib? If not, any hints to
> improve it if you don't mind?

I think you're better off keeping the channel open as well, and using it 
(just one channel) for all your requests, since you're sending only 
basic.publish (which is an async method). This way you can avoid the 
delay of sending channel.open and then waiting for channel.open_ok for 
every request.
Nagle is turned off in the Erlang client so the methods are sent promptly.
Also, I suggest you use amqp_channel:cast/3 rather than 
amqp_channel:call/3. The cast function returns a bit quicker than the 
call function (lets your process continue quicker).


Vlad.


-- 

 [][][] Vlad Alexandru Ionescu | Developer
   [][] LShift Ltd             | Tel: +44 (0)20 7729 7060
 []  [] www.lshift.net         | Email: vlad at lshift.net






More information about the rabbitmq-discuss mailing list