[bunny-amqp-devel] Publishing from multiple threads at once

6 views
Skip to first unread message

Mario Fernández

unread,
Oct 13, 2011, 3:22:49 AM10/13/11
to bunny-am...@rubyforge.org
Hi,

I'm pretty new to rabbitmq and bunny, and I've got a question about basic usage:
I'm building a Sinatra app that, when processing certain requests,
publish some information to an exchange to be processed later. My
first attempt was to build one client and an exchange, store them in
global variables, and have each request use it. This breaks when
multiple requests try to publish at the same time.

My question is, what is the best practice here? It is efficient to
instantiate a new client and exchange for each request that needs it?
Or is it better to maintain a pool of clients that can be used by the
requests as needed?

Cheers,
Mario
_______________________________________________
bunny-amqp-devel mailing list
bunny-am...@rubyforge.org
http://rubyforge.org/mailman/listinfo/bunny-amqp-devel

Reply all
Reply to author
Forward
0 new messages