Skip to content

Add dedicated executor to close connection in NIO mode #392

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged

Conversation

acogoluegnes
Copy link
Contributor

When sharing the same executor for NIO and connection closing, all the
threads of the pool can be busy recovering connections, leaving no
thread left for IO. This commit add a new executor service to the NIO
mode to submit all the connection closing to.

This is useful when an application maintains dozens or hundreds of
connections and suffers massive connection lost. Hundreds of connection
closing tasks can be submitted very quickly, so controlling the number
of threads and leaving some threads available for IO is critical.

If an application maintain just a few connections and can deal with the
creation of a few threads, using the new executor isn't necessary.

Fixes #380

When sharing the same executor for NIO and connection closing, all the
threads of the pool can be busy recovering connections, leaving no
thread left for IO. This commit add a new executor service to the NIO
mode to submit all the connection closing to.

This is useful when an application maintains dozens or hundreds of
connections and suffers massive connection lost. Hundreds of connection
closing tasks can be submitted very quickly, so controlling the number
of threads and leaving some threads available for IO is critical.

If an application maintain just a few connections and can deal with the
creation of a few threads, using the new executor isn't necessary.

Fixes #380
@michaelklishin michaelklishin merged commit d11e365 into master Aug 14, 2018
@michaelklishin michaelklishin deleted the rabbitmq-java-client-380-nio-connection-closing branch August 14, 2018 16:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants