Skip to content
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

Release shared JMS Connection when message listener container is stopped #30612

Closed
jhoeller opened this issue Jun 7, 2023 · 1 comment
Closed
Assignees
Labels
in: messaging Issues in messaging modules (jms, messaging) type: enhancement A general enhancement
Milestone

Comments

@jhoeller
Copy link
Contributor

jhoeller commented Jun 7, 2023

In alignment with #30242, DefaultMessageListenerContainer should proactively close the shared JMS Connection (if any) once the stop completion callback is triggered. While a regular stop() call will return before the invokers have actually stopped, the stop variant with a callback is effectively equivalent to the invoker handling in shutdown() where it is being followed by a closing of the shared Connection already.

On start(), the existing code path will automatically re-establish a JMS Connection already, just like when the Connection got closed due to an invoker exception. It seems generally sensible to close the Connection when not in use... since the chances of hitting a timeout or otherwise becoming stale are high while paused, so the Connection might need to be closed and re-established on re-start in any case.

@jhoeller jhoeller added in: messaging Issues in messaging modules (jms, messaging) type: enhancement A general enhancement labels Jun 7, 2023
@jhoeller jhoeller added this to the 6.1.0-M1 milestone Jun 7, 2023
@jhoeller jhoeller self-assigned this Jun 7, 2023
@jhoeller jhoeller changed the title Proactively close shared JMS Connection along with stop callback Release shared JMS Connection when message listener container is stopped Jun 7, 2023
@jhoeller
Copy link
Contributor Author

jhoeller commented Jun 7, 2023

On a related note, we release the shared JMS Connection on Single/CachingConnectionFactory.stop() as well now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in: messaging Issues in messaging modules (jms, messaging) type: enhancement A general enhancement
Projects
None yet
Development

No branches or pull requests

1 participant