This chapter provides an overview of the new features and improvements that have been introduced with Spring Integration 4.1. If you are interested in more details, please see the Issue Tracker tickets that were resolved as part of the 4.1 development process.
A Reactor Promise
return type is now supported for Messaging Gateway methods.
See Section 7.2.9, “Asynchronous Gateway”.
The WebSocket module is now available. It is fully based on the Spring WebSocket
and Spring Messaging modules and provides an <inbound-channel-adapter>
and an
<outbound-channel-adapter>
.
See Chapter 31, WebSockets Support for more information.
The Scatter-Gather EIP pattern is now implemented. See Section 5.7, “Scatter-Gather” for more information.
The Routing Slip EIP pattern implementation is now provided. See the section called “Routing Slip” for more information.
The Idempotent Receiver EIP implementation is now provided
via the <idempotent-receiver>
component in XML, or the
IdempotentReceiverInterceptor
and
IdempotentReceiver
annotation when using Java
Configuration.
See Section 7.7.7, “Idempotent Receiver EIP Pattern” and their JavaDocs for more information.
The Boon JsonObjectMapper
is now provided
for the JSON transformers. See Section 6.1, “Transformer” for more information.
The <redis-queue-inbound-gateway>
and
<redis-queue-outbound-gateway>
components are now provided.
See Section 23.10, “Redis Queue Inbound Gateway” and Section 23.9, “Redis Queue Outbound Gateway”.
The PollSkipAdvice
is now provided to be used within
<advice-chain>
of the <poller>
to determine if the current
poll should be suppressed (skipped) by some condition implemented with
PollSkipStrategy
.
See Section 3.2, “Poller (Polling Consumer)” for more information.
Elements that utilize a message listener container (inbound endpoints, channel)
now support the missing-queues-fatal
attribute.
See Chapter 10, AMQP Support for more information.
The AMQP outbound endpoints support a new property lazy-connect
(default true). When true, the connection to the broker is not established
until the first message arrives (assuming there are no inbound endpoints, which
always attempt to establish the connection during startup). When set the 'false' an
attempt to establish the connection is made during application startup.
See Chapter 10, AMQP Support for more information.
The SimpleMessageStore
no longer makes a copy of the group
when calling getMessageGroup()
.
See Caution with SimpleMessageStore for more information.
The <ws:outbound-gateway/>
now
provides an encode-uri
attribute to allow disabling the encoding of the URI object
before sending the request.
The <http:inbound-channel-adapter>
can now be configured with a
status-code-expression
to override the default 200 OK
status.
See Section 16.4, “HTTP Namespace Support” for more information.
The MQTT channel adapters can now be configured to connect to multiple servers, for example, to support High Availability (HA). See Chapter 22, MQTT Support for more information.
The MQTT message-driven channel adapter now supports specifying the QoS setting for each subscription. See Section 22.2, “Inbound (message-driven) Channel Adapter” for more information.
The MQTT outbound channel adapter now supports asynchronous sends, avoiding blocking until delivery is confirmed. See Section 22.3, “Outbound Channel Adapter” for more information.
It is now possible to programmatically subscribe to and unsubscribe from topics at runtime. See Section 22.2, “Inbound (message-driven) Channel Adapter” for more information.
The FTP and SFTP outbound channel adapters now support appending to remote files, as
well as taking specific actions when a remote file already exists. The remote file
templates now also support this as well as rmdir()
and exists()
.
In addition, the remote file templates provide access to the underlying client object
enabling access to low-level APIs.
See Chapter 14, FTP/FTPS Adapters and Chapter 26, SFTP Adapters for more information.
Splitter
components now support an Iterator
as the result object
for producing output messages.
See Section 5.3, “Splitter” for more information.
Aggregator
s now support a new attribute expire-groups-on-timeout
.
See Section 5.4.4, “Configuring an Aggregator” for more information.
An null-result-expression
attribute has been added, which is evaluated and returned if
<enricher>
returns null
.
It can be added in <header>
and <property>
.
See Section 6.2, “Content Enricher” for more information.
An error-channel
attribute has been added, which is used to handle an error flow
if Exception
occurs downstream of the request-channel
. This enable
you to return an alternative object to use for enrichment.
See Section 6.2, “Content Enricher” for more information.
The <header-enricher/>
's <header-channels-to-string/>
element can now override the header channel registry's default time for retaining channel
mappings.
See the section called “Header Channel Registry” for more information.
Improvements have been made to the orderly shutdown algorithm. See Section 8.6, “Orderly Shutdown” for more information.
The RecipientListRouter
provides now several management
operations to configure recipients at runtime.
With that the <recipient-list-router>
can now be configured without any
<recipient>
from the start.
See the section called “RecipientListRouterManagement” for more information.
The AbstractHeaderMapper
implementations now provides the additional
NON_STANDARD_HEADERS
token to map any user-defined headers, which aren't mapped by default.
See Section 10.8, “AMQP Message Headers” for more information.
The new template-channel-transacted
attribute has been introduced for AMQP
MessageChannel
s.
See Section 10.7, “AMQP Backed Message Channels” for more information.
The default syslog message converter now has an option to retain the original message in the payload, while still setting the headers. See Section 28.2, “Syslog <inbound-channel-adapter>” for more information.
In addition to the Promise
return type mentioned above,
gateway methods may now return a ListenableFuture
, introduced
in Spring Framework 4.0. You can also disable the async processing in the gateway,
allowing a downstream flow to directly return a Future
.
See Section 7.2.9, “Asynchronous Gateway”.
Aggregator
s and Resequencer
s now support an
<expire-advice-chain/>
and <expire-transactional/>
sub-elements
to advise the forceComplete
operation.
See Section 5.4.4, “Configuring an Aggregator” for more information.
The <int:outbound-channel-adapter/>
now supports the <script/>
sub-element. The underlying script must have a void
return type or return null
.
See Section 7.6, “Groovy support” and Section 7.5, “Scripting support”.
When a message group in a resequencer is timed out (using group-timeout
or a
MessageGroupStoreReaper
), late arriving messages will now be discarded
immediately by default.
See Section 5.5, “Resequencer”.
Now Spring Integration consistently handles the Java 8's Optional
type.
See Section 7.3.2, “Configuring Service Activator”.
The QueueChannel
backed Queue type
has been changed
from BlockingQueue
to the more generic
Queue
. It allows the use of any external
Queue
implementation, for example Reactor's
PersistentQueue
.
See the section called “QueueChannel Configuration”.
The ChannelInterceptor
now supports additional
afterSendCompletion()
and afterReceiveCompletion()
methods.
See Section 3.1.3, “Channel Interceptors”.