INT-4307: JMS: Endpoint Stop: Shutdown Container

JIRA: https://jira.spring.io/browse/INT-4307

Shut down the container (to close the connection) when a message-driven
endpoint is stopped while the application continues to run.
This commit is contained in:
Gary Russell
2018-09-13 14:32:49 -04:00
committed by Artem Bilan
parent 02c8e0ade2
commit 76b1d1df06
7 changed files with 191 additions and 4 deletions

View File

@@ -133,6 +133,10 @@ When consuming from topics, set the `pub-sub-domain` attribute to true.
Set `subscription-durable` to `true` for a durable subscription or `subscription-shared` for a shared subscription (which requires a JMS 2.0 broker and has been available since version 4.2).
Use `subscription-name` to name the subscription.
Starting with version 5.1, when the endpoint is stopped while the application remains running, the underlying listener container is shut down, closing its shared connection and consumers.
Previously, the connection and consumers remained open.
To revert to the previous behavior, set the `shutdownContainerOnStop` on the `JmsMessageDrivenEndpoint` to `false`.
[[jms-md-conversion-errors]]
==== Inbound Conversion Errors
@@ -249,6 +253,10 @@ IMPORTANT: Starting with version 4.2, the default `acknowledge` mode is `transac
In that case, you should configure the container as needed.
We recommend that you use `transacted` with the `DefaultMessageListenerContainer` to avoid message loss.
Starting with version 5.1, when the endpoint is stopped while the application remains running, the underlying listener container is shut down, closing its shared connection and consumers.
Previously, the connection and consumers remained open.
To revert to the previous behavior, set the `shutdownContainerOnStop` on the `JmsInboundGateway` to `false`.
[[jms-outbound-gateway]]
=== Outbound Gateway

View File

@@ -161,5 +161,7 @@ See https://github.com/spring-projects/spring-integration-extensions/tree/master
The `JmsSendingMessageHandler` now provides `deliveryModeExpression` and `timeToLiveExpression` options to determine respective QoS options for JMS message to send at runtime.
The `DefaultJmsHeaderMapper` now allows to map inbound `JMSDeliveryMode` and `JMSExpiration` properties via setting to `true` respective `setMapInboundDeliveryMode()` and `setMapInboundExpiration()` options.
When a `JmsMessageDrivenEndpoint` or `JmsInboundGateway` is stopped, the associated listener container is now shut down; this closes its shared connection and any consumers.
You can configure the endpoints to revert to the previous behavior.
See <<jms>> for more information.