[rabbitmq-discuss] Breaking API changes in JAva API 2.7.0

Irmo Manie irmo.manie at gmail.com
Mon Nov 21 19:13:28 GMT 2011

> And, of course, I read the JavaThreadPool implementations again, and we don't
> have to shutdown our private ExecutorService when the connection fails, because
> if it is not used it allocates no threads, and can be successfully GC'd when we
> lose the reference.  Ergo, no leak.
> We have to shut it down when we close the connection of course, and we do.

Ah, you're absolutely right there!

> The best solution here is *not* to shutdown the executor service on connection
> close *unless it is our own private one*. And to lift the restriction that the
> ExecutorService must not be shared between connections.  This then allows the
> user to allocate any ExecutorService to the consumer callbacks of a connection,
> including sharing a service among several connections.
> Let me know what you think.

To differentiate between private and given is a good thing I reckon.
When someone provides its own Executor, they should take full
responsibility for it and thus also close/stop it.

- Irmo

More information about the rabbitmq-discuss mailing list