See the Migration Guide for important changes that might affect your applications. You can find migration guides for all versions back to 2.1 on the wiki.
Version 4.2 added a number of new components.
We added a new MetricsFactory strategy interface.
This change, together with other changes in the JMX and management infrastructure, provides much more control over management configuration and runtime performance.
However, this has some important implications for (some) user environments.
For complete details, see Metrics and Management and JMX Improvements.
The MongoDbMetadataStore is now available.
For more information, see MongoDB Metadata Store.
We introduced the @SecuredChannel annotation, replacing the deprecated ChannelSecurityInterceptorFactoryBean.
For more information, see Security in Spring Integration.
We introduced the SecurityContextPropagationChannelInterceptor for the SecurityContext propagation from one message flow’s thread to another.
For more information, see Security in Spring Integration.
In 4.1.2, we added FileSplitter, which splits text files into lines.
It now has full support in the int-file: namespace.
See File Splitter for more information.
We added Zookeeper support to the framework to assist when running on a clustered or multi-host environment. The change impacts the following features:
-
ZookeeperMetadataStore -
ZookeeperLockRegistry -
Zookeeper Leadership
See Zookeeper Support for more information.
A new thread <int:barrier/> component is available, letting a thread be suspended until some asynchronous event occurs.
See Thread Barrier for more information.
We added STOMP support to the framework as an inbound and outbound channel adapters pair. See STOMP Support for more information.
A new Codec abstraction has been introduced, to encode and decode objects to and from byte[].
We added an implementation that uses Kryo.
We also added codec-based transformers and message converters.
See Codec for more information.
A new MessagePreparedStatementSetter functional interface callback is available for the JdbcMessageHandler (<int-jdbc:outbound-gateway> and <int-jdbc:outbound-channel-adapter>) as an alternative to using SqlParameterSourceFactory to populate parameters on the PreparedStatement with the requestMessage context.
See Outbound Channel Adapter for more information.
This section describes general changes from version 4.1 to version 4.2.
As an alternative to the existing selector attribute, the <wire-tap/> element now supports the selector-expression attribute.
See File Support for more information about these changes.
The <int-file:outbound-channel-adapter> and <int-file:outbound-gateway> now support an append-new-line attribute.
If set to true, a new line is appended to the file after a message is written.
The default attribute value is false.
Ignoring Hidden Files
We added the ignore-hidden attribute for the <int-file:inbound-channel-adapter> to let you set whether to pick up hidden files from the source directory.
It defaults to true.
The FileWritingMessageHandler now also accepts InputStream as a valid message payload type.
You can now use the HeadDirectoryScanner with other FileListFilter implementations.
We moved the ScatterGatherHandler class from the org.springframework.integration.handler to the org.springframework.integration.scattergather.
This section describes general changes to the Spring Integration TCP functionality.
The TCP Serializers no longer flush() the OutputStream.
This is now done by the TcpNxxConnection classes.
If you use the serializers directly within your code, you may have to flush() the OutputStream.
TcpConnectionServerExceptionEvent instances are now published whenever an unexpected exception occurs on a TCP server socket (also added to 4.1.3 and 4.0.7).
See TCP Connection Events for more information.
If you configure a TCP server socket factory to listen on a random port, you can now obtain the actual port chosen by the OS by using getPort().
getServerSocketAddress() is also available.
See "TCP Connection Factories" for more information.
The TcpOutboundGateway now supports remote-timeout-expression as an alternative to the existing remote-timeout attribute.
This allows setting the timeout based on each message.
Also, the remote-timeout no longer defaults to the same value as reply-timeout, which has a completely different meaning.
See .TCP Outbound Gateway Attributes for more information.
TcpConnection implementations now support getSslSession() to let you extract information from the session to add to message headers.
See IP Message Headers for more information.
New events are now published whenever a correlation exception occurs — such as sending a message to a non-existent socket.
The TcpConnectionEventListeningMessageProducer is deprecated.
Use the generic event adapter instead.
See TCP Connection Events for more information.
Previously, the @Poller on an inbound channel adapter defaulted the maxMessagesPerPoll attribute to -1 (infinity).
This was inconsistent with the XML configuration of <inbound-channel-adapter/>, which defaults to 1.
The annotation now defaults this attribute to 1.
o.s.integration.util.FunctionIterator now requires a o.s.integration.util.Function instead of a reactor.function.Function.
This was done to remove an unnecessary hard dependency on Reactor.
Any uses of this iterator need to change the import.
Reactor is still supported for functionality such as the Promise gateway.
The dependency was removed for those users who do not need it.
This section describes general changes to the Spring Integration TCP functionality.
You can now configure the reply listener in JMS outbound gateways to be initialized on-demand and stopped after an idle period, instead of being controlled by the gateway’s lifecycle. See Outbound Gateway for more information.
The error-channel is now used for the conversion errors.
In previous versions, they caused transaction rollback and message redelivery.
See Message-driven Channel Adapter and Inbound Gateway for more information.
When using an implicitly defined DefaultMessageListenerContainer, the default acknowledge is now transacted.
We recommend using transacted 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 Message-driven Channel Adapter and Inbound Gateway for more information.
We added Namespace support for shared subscriptions (JMS 2.0) to message-driven endpoints and the <int-jms:publish-subscribe-channel>.
Previously, you had to wire up listener containers as <bean/> declarations to use shared connections.
See JMS Support for more information.
We now provide much more flexibility for dynamic polling.
See Conditional Pollers for Message Sources for more information.
This section describes general changes to the Spring Integration AMQP functionality.
The <int-amqp:outbound-gateway> now supports confirm-correlation-expression, confirm-ack-channel, and confirm-nack-channel attributes (which have a purpose similar to that of <int-amqp:outbound-channel-adapter>).
For both the outbound channel adapter and the inbound gateway, if the correlation data is a Message<?>, it becomes the basis of the message on the ack or nack channel, with the additional header(s) added.
Previously, any correlation data (including Message<?>) was returned as the payload of the ack or nack message.
The <int-amqp:inbound-gateway> now exposes the amqp-template attribute to allow more control over an external bean for the reply RabbitTemplate.
You can also provide your own AmqpTemplate implementation.
In addition, you can use default-reply-to if the request message does not have a replyTo property.
See AMQP Support for more information.
The XPathMessageSplitter (<int-xml:xpath-splitter>) now allows the configuration of output-properties for the internal javax.xml.transform.Transformer and supports an Iterator mode (defaults to true) for the XPath evaluation org.w3c.dom.NodeList result.
See Splitting XML Messages for more information.
This section describes general changes to the Spring Integration HTTP functionality.
The HTTP inbound endpoints (<int-http:inbound-channel-adapter> and <int-http:inbound-gateway>) now allow the
configuration of Cross-origin Resource Sharing (CORS).
See Cross-origin Resource Sharing (CORS) Support for more information.
You can configure the HTTP inbound gate way to return a status code that you specify when a request times out.
The default is now 500 Internal Server Error instead of 200 OK.
See Response Status Code for more information.
We added documentation for proxying multipart/form-data requests.
See HTTP Support for more information.
This section describes general changes to the Spring Integration Gateway functionality.
When using Java 8, gateway methods can now return CompletableFuture<?>.
See CompletableFuture for more information.
The request and reply timeout properties are now String instead of Long to allow configuration with property placeholders or SpEL.
See @MessagingGateway Annotation.
This section describes general changes to the Spring Integration aggregator functionality.
This release includes some performance improvements for aggregating components (aggregator, resequencer, and others), by more efficiently removing messages from groups when they are released.
New methods (removeMessagesFromGroup) have been added to the message store.
Set the removeBatchSize property (default: 100) to adjust the number of messages deleted in each operation.
Currently, the JDBC, Redis, and MongoDB message stores support this property.
When using a ref or inner bean for the aggregator, you can now directly bind a MessageGroupProcessor.
In addition, we added a SimpleMessageGroupProcessor that returns the collection of messages in the group.
When an output processor produces a collection of Message<?>, the aggregator releases those messages individually.
Configuring the SimpleMessageGroupProcessor makes the aggregator a message barrier, where messages are held up until they all arrive and are then released individually.
See Aggregator for more information.
This section describes general changes to the Spring Integration FTP and SFTP functionality.
You can now specify a remote-directory-expression on the inbound channel adapters, to determine the directory at runtime.
See FTP/FTPS Adapters and SFTP Adapters for more information.
When you use FTP or SFTP outbound gateways to operate on multiple files (with mget and mput), an exception can
occur after part of the request is completed.
If such a condition occurs, a PartialSuccessException that contains the partial results is thrown.
See FTP Outbound Gateway and SFTP Outbound Gateway for more information.
We added a delegating session factory, enabling the selection of a particular session factory based on some thread context value.
See Delegating Session Factory and Delegating Session Factory for more information.
Previously, the DefaultSftpSessionFactory unconditionally allowed connections to unknown hosts.
This is now configurable (default: false).
The factory now requires a configured knownHosts, file unless the allowUnknownKeys property is true (default: false).
See allowUnknownKeys::Set to true to allow connections to hosts with unknown (or changed) keys. for more information.
We introduced the MessageSessionCallback<F, T> to perform any custom Session operations with the requestMessage context in the <int-(s)ftp:outbound-gateway/>.
See Using MessageSessionCallback and MessageSessionCallback for more information.
We added WebSocketHandlerDecoratorFactory support to the ServerWebSocketContainer to allow chained customization for the internal WebSocketHandler.
See WebSockets Namespace Support for more information.
The ApplicationEvent adapters can now operate with payload as an event to directly allow omitting custom ApplicationEvent extensions.
For this purpose, we introduced the publish-payload boolean attribute has been introduced on the <int-event:outbound-channel-adapter>.
See Spring ApplicationEvent Support for more information.