[rabbitmq-discuss] Java Client Changes

Rob Harrop rob at rabbitmq.com
Fri Oct 15 11:00:41 BST 2010


On 15 Oct 2010, at 10:03, mabrek <mabrek at gmail.com> wrote:

> On 10/12/2010 05:39 PM, Rob Harrop wrote:
>> Summary of changes:
>> 
>> * Dispatch to consumers now happens on a separate thread from the Connection thread
> 
> Have you considered switching to NIO with one io-loop thread per connection/several connections?
> Something like Netty or Apache Mina.

We've been chewing over NIO a bit recently. It's possible that we'll switch over but currently I think 1 IO thread per connection is sufficient.

> 
>> * Each Channel has its own dispatch thread
> 
> It can result in creating too many threads.

This is bounded by the number of channels.

> 
>> * Channels are safe for use from multiple threads (not suitable for heavy concurrent usage though)
> 
> Consider web appication scenario. It sends a message per incoming request. Requests are served from several threads (up to 100) with a heavy concurrency (hundreds requests per second). So application needs either thread-safe non-blocking publisher that is suitable for heavy concurrency or very light-weight non-thread-safe publisher that can be created per incoming request and deleted after use.

Channels are pretty light to create. But I can certainly see a case where thread usage can go crazy.

I'm on vacation this weekend but I'm pondering a solution to general thread pooling that will allow for a pluggable ExecutorService. The solution I have in mind will guarantee per consumer ordering and is not susceptible to stalling.

> 
> Regards,
> Anton Lebedevich.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rabbitmq.com/pipermail/rabbitmq-discuss/attachments/20101015/d2021104/attachment.htm>


More information about the rabbitmq-discuss mailing list