[rabbitmq-discuss] JavaClient HeartbeatSender

Michael Klishin mklishin at gopivotal.com
Fri Feb 21 10:48:34 GMT 2014


On 21 Feb 2014, at 14:13, Dmitry Andrianov <dmitry.andrianov at alertme.com> wrote:

> But it won't be possible to see that this particular newThread() is invoked by executor created by HeartbeatSender?

If you provide a ThreadFactory, j.u.c. executors will use it. I’m not sure what you’re saying.

> If we return the same thread without such checks we effectively make the entire stress testing client single threaded so it won't serve its purpose.

You said you intend to open lots of connections. If that’s the case, all connections will share a heartbeat thread but network I/O
threads won’t be shared. Consumer work pool executor can be shared via ConnectionFactory#setSharedExecutor (I don’t recall if this is in 3.2 or not).

In practice shared consumer work pool executor makes much more difference than heartbeat sender.
If the # of threads is a limiting factor for your test suite (can’t you just use multiple machines?),
consider using Go client [1] for your stress tests.

1. http://github.com/streadway/amqp

MK

Software Engineer, Pivotal/RabbitMQ




More information about the rabbitmq-discuss mailing list