INT-3784: Use acknowledge="transacted" by Default

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

Also

- suppress WARN log when priority mapping fails
- rework extract payload tests to use a single context

Make a new `JmsMessageDrivenEndpoint` as `private` because it makes sense only for XML `BeanDefinition` variant.
This commit is contained in:
Gary Russell
2015-07-31 14:37:31 -04:00
committed by Artem Bilan
parent 4cca684f36
commit fd35d43aba
11 changed files with 308 additions and 157 deletions

View File

@@ -65,7 +65,7 @@ In earlier versions, you had to inject a `JmsTemplate` with `sessionTransacted`
Note, however, that setting `session-transacted` to `true` has little value because the transaction is committed immediately after the `receive()` and before the message is sent to the `channel`,
If you want the entire flow to be transactional (for example if there is a downstream outbound channel adapter), you must use a `transactional` poller, with a `JmsTransactionManager`.
Or, consider using a `jms-message-driven-channel-adapter` with `acknowledge` set to `transacted`.
Or, consider using a `jms-message-driven-channel-adapter` with `acknowledge` set to `transacted` (the default).
[[jms-message-driven-channel-adapter]]
=== Message-Driven Channel Adapter
@@ -89,6 +89,10 @@ If you have a custom listener container implementation (usually a subclass of `D
In that case, the attributes on the adapter are transferred to an instance of your custom container.
=====
IMPORTANT: Starting with _version 4.2_, the default `acknowledge` mode is `transacted`, unless an external
container is provided, in which case the container should be configured as needed.
It is recommended to use `transacted` with the `DefaultMessageListenerContainer` to avoid message loss.
The 'extract-payload' property has the same effect as described above, and once again its default value is 'true'.
The poller sub-element is not applicable for a message-driven Channel Adapter, as it will be actively invoked.
For most usage scenarios, the message-driven approach is better since the Messages will be passed along to the `MessageChannel` as soon as they are received from the underlying JMS consumer.
@@ -206,6 +210,10 @@ for a durable subscription, `subscription-shared` for a shared subscription (req
has been available since _version 4.2_).
Use `subscription-name` to name the subscription.
IMPORTANT: Starting with _version 4.2_, the default `acknowledge` mode is `transacted`, unless an external
container is provided, in which case the container should be configured as needed.
It is recommended to use `transacted` with the `DefaultMessageListenerContainer` to avoid message loss.
[[jms-outbound-gateway]]
=== Outbound Gateway

View File

@@ -168,6 +168,15 @@ The `error-channel` now is used for the conversion errors, which have caused a t
See <<jms-message-driven-channel-adapter>> and <<jms-inbound-gateway>> for more information.
===== Default Acknowledge Mode
When using an implicitly defined `DefaultMessageListenerContainer`, the default `acknowledge` is now `transacted`.
`transacted` is recommended when using this container, to avoid message loss.
This default now applies to the message-driven inbound adapter and the inbound gateway, it was already the
default for jms-backed channels.
See <<jms-message-driven-channel-adapter>> and <<jms-inbound-gateway>> for more information.
===== Shared Subscriptions
Namespace support for shared subscriptions (JMS 2.0) has been added to message-driven endpoints and the