1. What's new in Spring Integration 4.1?

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.

1.1 New Components

1.1.1 Promise<?> Gateway

A Reactor Promise return type is now supported for Messaging Gateway methods. See Section 7.2.9, “Asynchronous Gateway”.

1.1.2 WebSocket support

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.

1.1.3 Scatter-Gather EIP pattern

The Scatter-Gather EIP pattern is now implemented. See Section 5.7, “Scatter-Gather” for more information.

1.1.4 Routing Slip Pattern

The Routing Slip EIP pattern implementation is now provided. See the section called “Routing Slip” for more information.

1.1.5 Idempotent Receiver Pattern

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 Enterprise Integration Pattern” and their JavaDocs for more information.

1.1.6 BoonJsonObjectMapper

The Boon JsonObjectMapper is now provided for the JSON transformers. See Section 6.1, “Transformer” for more information.

1.1.7 Redis Queue Gateways

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”.

1.1.8 PollSkipAdvice

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.

1.2 General Changes

1.2.1 AMQP Inbound Endpoints, Channel

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.

1.2.2 AMQP Outbound Endpoints

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.

1.2.3 SimpleMessageStore

The SimpleMessageStore no longer makes a copy of the group when calling getMessageGroup(). See Caution with SimpleMessageStore for more information.

1.2.4 Web Service Outbound Gateway: encode-uri

The <ws:outbound-gateway/> now provides an encode-uri attribute to allow disabling the encoding of the URI object before sending the request.

1.2.5 Http Inbound Channel Adapter and StatusCode

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.

1.2.6 MQTT Adapter Changes

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.

1.2.7 FTP/SFTP Adapter Changes

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.

1.2.8 Splitter and Iterator

Splitter components now support an Iterator as the result object for producing output messages. See Section 5.3, “Splitter” for more information.

1.2.9 Aggregator

Aggregators now support a new attribute expire-groups-on-timeout. See Section 5.4.4, “Configuring an Aggregator” for more information.

1.2.10 Content Enricher Improvements

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.

1.2.11 Header Channel Registry

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.

1.2.12 Orderly Shutdown

Improvements have been made to the orderly shutdown algorithm. See Section 8.6, “Orderly Shutdown” for more information.

1.2.13 Management for RecipientListRouter

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.

1.2.14 AbstractHeaderMapper: NON_STANDARD_HEADERS token

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.

1.2.15 AMQP Channels: template-channel-transacted

The new template-channel-transacted attribute has been introduced for AMQP MessageChannels. See Section 10.7, “AMQP Backed Message Channels” for more information.

1.2.16 Syslog Adapter

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.

1.2.17 Async Gateway

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”.

1.2.18 Aggregator Advice Chain

Aggregators and Resequencers 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.

1.2.19 Outbound Channel Adapter and Scripts

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”.

1.2.20 Resequencer Changes

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”.

1.2.21 Optional POJO method parameter

Now Spring Integration consistently handles the Java 8's Optional type. See Section 7.3.2, “Configuring Service Activator”.

1.2.22 QueueChannel: backed Queue type

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”.

1.2.23 ChannelInterceptor Changes

The ChannelInterceptor now supports additional afterSendCompletion() and afterReceiveCompletion() methods. See Section 3.1.3, “Channel Interceptors”.

1.2.24 IMAP PEEK

Since version 4.1.1 there is a change of behavior if you explicitly set the javamail property mail.[protocol].peek to false (where [protocol] is imap or imaps). See Important: IMAP PEEK.