For the latest stable version, please use Spring Integration 6.3.4!spring-doc.cn

For the latest stable version, please use Spring Integration 6.3.4!spring-doc.cn

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.spring-doc.cn

New Components

Version 4.2 added a number of new components.spring-doc.cn

Major Management/JMX Rework

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.spring-doc.cn

However, this has some important implications for (some) user environments.spring-doc.cn

For complete details, see Metrics and Management and JMX Improvements.spring-doc.cn

MongoDB Metadata Store

The MongoDbMetadataStore is now available. For more information, see MongoDB Metadata Store.spring-doc.cn

SecuredChannel Annotation

We introduced the @SecuredChannel annotation, replacing the deprecated ChannelSecurityInterceptorFactoryBean. For more information, see Security in Spring Integration.spring-doc.cn

SecurityContext Propagation

We introduced the SecurityContextPropagationChannelInterceptor for the SecurityContext propagation from one message flow’s thread to another. For more information, see Security in Spring Integration.spring-doc.cn

FileSplitter

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.spring-doc.cn

Zookeeper Support

We added Zookeeper support to the framework to assist when running on a clustered or multi-host environment. The change impacts the following features:spring-doc.cn

See Zookeeper Support for more information.spring-doc.cn

Thread Barrier

A new thread <int:barrier/> component is available, letting a thread be suspended until some asynchronous event occurs. See Thread Barrier for more information.spring-doc.cn

STOMP Support

We added STOMP support to the framework as an inbound and outbound channel adapters pair. See STOMP Support for more information.spring-doc.cn

Codec

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.spring-doc.cn

Message PreparedStatement Setter

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.spring-doc.cn

General Changes

This section describes general changes from version 4.1 to version 4.2.spring-doc.cn

WireTap

As an alternative to the existing selector attribute, the <wire-tap/> element now supports the selector-expression attribute.spring-doc.cn

File Changes

See File Support for more information about these changes.spring-doc.cn

Appending New Lines

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.spring-doc.cn

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.spring-doc.cn

Writing InputStream Payloads

The FileWritingMessageHandler now also accepts InputStream as a valid message payload type.spring-doc.cn

HeadDirectoryScanner

You can now use the HeadDirectoryScanner with other FileListFilter implementations.spring-doc.cn

Last Modified Filter

We added the LastModifiedFileListFilter.spring-doc.cn

Watch Service Directory Scanner

We added the WatchServiceDirectoryScanner.spring-doc.cn

Persistent File List Filter Changes

The AbstractPersistentFileListFilter has a new property (flushOnUpdate) which, when set to true, calls flush() on the metadata store if it implements Flushable (for example, PropertiesPersistingMetadataStore).spring-doc.cn

Class Package Change

We moved the ScatterGatherHandler class from the org.springframework.integration.handler to the org.springframework.integration.scattergather.spring-doc.cn

TCP Changes

This section describes general changes to the Spring Integration TCP functionality.spring-doc.cn

TCP Serializers

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.spring-doc.cn

Server Socket Exceptions

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.spring-doc.cn

TCP Server Port

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.spring-doc.cn

See "TCP Connection Factories" for more information.spring-doc.cn

TCP Gateway Remote Timeout

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.spring-doc.cn

Also, the remote-timeout no longer defaults to the same value as reply-timeout, which has a completely different meaning.spring-doc.cn

TCP SSLSession Available for Header Mapping

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.spring-doc.cn

TCP Events

New events are now published whenever a correlation exception occurs — such as sending a message to a non-existent socket.spring-doc.cn

The TcpConnectionEventListeningMessageProducer is deprecated. Use the generic event adapter instead.spring-doc.cn

See TCP Connection Events for more information.spring-doc.cn

@InboundChannelAdapter Changes

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.spring-doc.cn

API Changes

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.spring-doc.cn

Reactor is still supported for functionality such as the Promise gateway. The dependency was removed for those users who do not need it.spring-doc.cn

JMS Changes

This section describes general changes to the Spring Integration TCP functionality.spring-doc.cn

Reply Listener Lazy Initialization

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.spring-doc.cn

Conversion Errors in Message-Driven Endpoints

The error-channel is now used for the conversion errors. In previous versions, they caused transaction rollback and message redelivery.spring-doc.cn

Default Acknowledge Mode

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.spring-doc.cn

Shared Subscriptions

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.spring-doc.cn

See JMS Support for more information.spring-doc.cn

Conditional Pollers

We now provide much more flexibility for dynamic polling.spring-doc.cn

AMQP Changes

This section describes general changes to the Spring Integration AMQP functionality.spring-doc.cn

Publisher Confirmations

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>).spring-doc.cn

Correlation Data

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.spring-doc.cn

Inbound Gateway Properties

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.spring-doc.cn

See AMQP Support for more information.spring-doc.cn

XPath Splitter Improvements

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.spring-doc.cn

See Splitting XML Messages for more information.spring-doc.cn

HTTP Changes

This section describes general changes to the Spring Integration HTTP functionality.spring-doc.cn

CORS

The HTTP inbound endpoints (<int-http:inbound-channel-adapter> and <int-http:inbound-gateway>) now allow the configuration of Cross-origin Resource Sharing (CORS).spring-doc.cn

Inbound Gateway Timeout

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.spring-doc.cn

See Response Status Code for more information.spring-doc.cn

Form Data

We added documentation for proxying multipart/form-data requests. See HTTP Support for more information.spring-doc.cn

Gateway Changes

This section describes general changes to the Spring Integration Gateway functionality.spring-doc.cn

[[gateway-methods-can-return-completablefuture<?>]] ==== Gateway Methods can Return CompletableFuture<?>spring-doc.cn

When using Java 8, gateway methods can now return CompletableFuture<?>. See CompletableFuture for more information.spring-doc.cn

MessagingGateway Annotation

The request and reply timeout properties are now String instead of Long to allow configuration with property placeholders or SpEL. See @MessagingGateway Annotation.spring-doc.cn

Aggregator Changes

This section describes general changes to the Spring Integration aggregator functionality.spring-doc.cn

Aggregator Performance

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.spring-doc.cn

Output Message Group Processor

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.spring-doc.cn

FTP and SFTP Changes

This section describes general changes to the Spring Integration FTP and SFTP functionality.spring-doc.cn

Inbound Channel Adapters

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.spring-doc.cn

Gateway Partial Results

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.spring-doc.cn

Delegating Session Factory

We added a delegating session factory, enabling the selection of a particular session factory based on some thread context value.spring-doc.cn

Default Sftp Session Factory

Previously, the DefaultSftpSessionFactory unconditionally allowed connections to unknown hosts. This is now configurable (default: false).spring-doc.cn

The factory now requires a configured knownHosts, file unless the allowUnknownKeys property is true (default: false).spring-doc.cn

Message Session Callback

We introduced the MessageSessionCallback<F, T> to perform any custom Session operations with the requestMessage context in the <int-(s)ftp:outbound-gateway/>.spring-doc.cn

Websocket Changes

We added WebSocketHandlerDecoratorFactory support to the ServerWebSocketContainer to allow chained customization for the internal WebSocketHandler. See WebSockets Namespace Support for more information.spring-doc.cn

Application Event Adapters changes

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.spring-doc.cn