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

Changes between 4.2 and 4.3

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.3 added a number of new components.spring-doc.cn

AMQP Async Outbound Gateway

MessageGroupFactory

We introduced the MessageGroupFactory strategy to allow control over MessageGroup instances in MessageGroupStore logic. We added SimpleMessageGroupFactory implementation for the SimpleMessageGroup, with the GroupType.HASH_SET as the default factory for the standard MessageGroupStore implementations. See Message Store for more information.spring-doc.cn

PersistentMessageGroup

We added the PersistentMessageGroup (lazy-load proxy) implementation for persistent MessageGroupStore instances, which return this instance for the getMessageGroup() when their lazyLoadMessageGroups is true (the default). See Message Store for more information.spring-doc.cn

FTP and SFTP Streaming Inbound Channel Adapters

We added inbound channel adapters that return an InputStream for each file, letting you retrieve remote files without writing them to the local file system. See FTP Streaming Inbound Channel Adapter and SFTP Streaming Inbound Channel Adapter for more information.spring-doc.cn

StreamTransformer

We added StreamTransformer to transform an InputStream payload to either a byte[] or a String. See Stream Transformer for more information.spring-doc.cn

Integration Graph

We added IntegrationGraphServer, together with the IntegrationGraphController REST service, to expose the runtime model of a Spring Integration application as a graph. See Integration Graph for more information.spring-doc.cn

JDBC Lock Registry

We added JdbcLockRegistry for distributed locks shared through a database table. See JDBC Lock Registry for more information.spring-doc.cn

LeaderInitiator for LockRegistry

We added LeaderInitiator implementation based on the LockRegistry strategy. See Leadership Event Handling for more information.spring-doc.cn

General Changes

This section describes general changes that version 4.3 brought to Spring Integration.spring-doc.cn

Core Changes

This section describes general changes to the core of Spring Integration.spring-doc.cn

Outbound Gateway within a Chain

Previously, you could specify a reply-channel on an outbound gateway within a chain. It was completely ignored. The gateway’s reply goes to the next chain element or, if the gateway is the last element, to the chain’s output channel. This condition is now detected and disallowed. If you have such a configuration, remove the reply-channel.spring-doc.cn

Asynchronous Service Activator

We added an option to make the service activator be synchronous. See Asynchronous Service Activator for more information.spring-doc.cn

Messaging Annotation Support changes

The messaging annotation support does not require a @MessageEndpoint (or any other @Component) annotation declaration on the class level. To restore the previous behavior, set the spring.integration.messagingAnnotations.require.componentAnnotation of spring.integration.properties to true. See Global Properties and Annotation Support for more information.spring-doc.cn

Mail Changes

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

Customizable User Flag

The customizable userFlag (added in 4.2.2 to provide customization of the flag used to denote that the mail has been seen) is now available in the XML namespace. See Marking IMAP Messages When Recent Is Not Supported for more information.spring-doc.cn

Mail Message Mapping

You can now map inbound mail messages with the MessageHeaders containing the mail headers and the payload containing the email content. Previously, the payload was always the raw MimeMessage. See Inbound Mail Message Mapping for more information.spring-doc.cn

JMS Changes

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

Header Mapper

The DefaultJmsHeaderMapper now maps the standard correlationId header as a message property by invoking its toString() method. See Mapping Message Headers to and from JMS Message for more information.spring-doc.cn

Asynchronous Gateway

The JMS outbound gateway now has an async property. See Async Gateway for more information.spring-doc.cn

Aggregator Changes

There is a change in behavior when a POJO aggregator releases a collection of Message<?> objects. This is rare, but, if your application does that, you need to make a small change to your POJO. See this IMPORTANT: The SimpleMessageGroup.getMessages() method returns an unmodifiableCollection. note for more information.spring-doc.cn

[[tcp/udp-changes]] === TCP/UDP Changesspring-doc.cn

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

Events

A new TcpConnectionServerListeningEvent is emitted when a server connection factory is started. See TCP Connection Events for more information.spring-doc.cn

You can now use the destination-expression and socket-expression attributes on <int-ip:udp-outbound-channel-adapter>. See UDP Adapters for more information.spring-doc.cn

Stream Deserializers

The various deserializers that cannot allocate the final buffer until the whole message has been assembled now support pooling the raw buffer into which the data is received rather than creating and discarding a buffer for each message. See TCP Connection Factories for more information.spring-doc.cn

TCP Message Mapper

The message mapper now, optionally, sets a configured content type header. See IP Message Headers for more information.spring-doc.cn

File Changes

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

Destination Directory Creation

The generated file name for the FileWritingMessageHandler can represent a sub-path to save the desired directory structure for a file in the target directory. See Generating File Names for more information.spring-doc.cn

The FileReadingMessageSource now hides the WatchService directory scanning logic in the inner class. We added the use-watch-service and watch-events options to enable this behavior. We deprecated the top-level WatchServiceDirectoryScanner because of inconsistency around the API. See WatchServiceDirectoryScanner for more information.spring-doc.cn

Buffer Size

When writing files, you can now specify the buffer size.spring-doc.cn

Appending and Flushing

You can now avoid flushing files when appending and use a number of strategies to flush the data during idle periods. See Flushing Files When Using APPEND_NO_FLUSH for more information.spring-doc.cn

Preserving Timestamps

You can now configure the outbound channel adapter to set the destination file’s lastmodified timestamp. See File Timestamps for more information.spring-doc.cn

Splitter Changes

The FileSplitter now automatically closes an FTP or SFTP session when the file is completely read. This applies when the outbound gateway returns an InputStream or when you use the new FTP or SFTP streaming channel adapters. We also introduced a new markers-json option to convert FileSplitter.FileMarker to JSON String for relaxed downstream network interaction. See File Splitter for more information.spring-doc.cn

File Filters

We added ChainFileListFilter as an alternative to CompositeFileListFilter. See Reading Files for more information.spring-doc.cn

AMQP Changes

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

Content Type Message Converter

The outbound endpoints now support a RabbitTemplate configured with a ContentTypeDelegatingMessageConverter such that you can choose the converter based on the message content type. See Outbound Message Conversion for more information.spring-doc.cn

Headers for Delayed Message Handling

Spring AMQP 1.6 adds support for delayed message exchanges. Header mapping now supports the headers (amqp_delay and amqp_receivedDelay) used by this feature.spring-doc.cn

AMQP-Backed Channels

AMQP-backed channels now support message mapping. See AMQP-backed Message Channels for more information.spring-doc.cn

Redis Changes

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

[[list-push/pop-direction]] ==== List Push/Pop Directionspring-doc.cn

Previously, the queue channel adapters always used the Redis list in a fixed direction, pushing to the left end and reading from the right end. You can now configure the reading and writing direction with the rightPop and leftPush options for the RedisQueueMessageDrivenEndpoint and RedisQueueOutboundChannelAdapter, respectively. See Redis Queue Inbound Channel Adapter and Redis Queue Outbound Channel Adapter for more information.spring-doc.cn

Queue Inbound Gateway Default Serializer

The default serializer in the inbound gateway has been changed to a JdkSerializationRedisSerializer for compatibility with the outbound gateway. See Redis Queue Inbound Gateway for more information.spring-doc.cn

HTTP Changes

Previously, with requests that had a body (such as POST) that had no content-type header, the body was ignored. With this release, the content type of such requests is considered to be application/octet-stream as recommended by RFC 2616. See Http Inbound Components for more information.spring-doc.cn

uriVariablesExpression now uses a SimpleEvaluationContext by default (since 4.3.15). See Mapping URI Variables for more information.spring-doc.cn

SFTP Changes

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

Factory Bean

We added a new factory bean to simplify the configuration of Jsch proxies for SFTP. See JschProxyFactoryBean for more information.spring-doc.cn

chmod Changes

The SFTP outbound gateway (for put and mput commands) and the SFTP outbound channel adapter now support the chmod attribute to change the remote file permissions after uploading. See SFTP Outbound Channel Adapter and SFTP Outbound Gateway for more information.spring-doc.cn

FTP Changes

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

Session Changes

The FtpSession now supports null for the list() and listNames() methods, since underlying FTP Client can use it. With that, you can now configure the FtpOutboundGateway without the remoteDirectory expression. You can also configure the <int-ftp:inbound-channel-adapter> without remote-directory or remote-directory-expression. See FTP/FTPS Adapters for more information.spring-doc.cn

Router Changes

The ErrorMessageExceptionTypeRouter now supports the Exception superclass mappings to avoid duplication for the same channel in case of multiple inheritors. For this purpose, the ErrorMessageExceptionTypeRouter loads mapping classes during initialization to fail-fast for a ClassNotFoundException.spring-doc.cn

See Routers for more information.spring-doc.cn

Header Mapping

This section describes the changes to header mapping between version 4.2 and 4.3.spring-doc.cn

General

AMQP, WS, and XMPP header mappings (such as request-header-mapping and reply-header-mapping) now support negated patterns. See AMQP Message Headers, WS Message Headers, and XMPP Message Headers for more information.spring-doc.cn

AMQP Header Mapping

Previously, only standard AMQP headers were mapped by default. You had to explicitly enable mapping of user-defined headers. With this release, all headers are mapped by default. In addition, the inbound amqp_deliveryMode header is no longer mapped by default. See AMQP Message Headers for more information.spring-doc.cn

Groovy Scripts

You can now configure groovy scripts with the compile-static hint or any other CompilerConfiguration options. See Groovy Configuration for more information.spring-doc.cn

@InboundChannelAdapter Changes

The @InboundChannelAdapter now has an alias channel attribute for the regular value. In addition, the target SourcePollingChannelAdapter components can now resolve the target outputChannel bean from its provided name (outputChannelName options) in a late-binding manner. See Annotation Support for more information.spring-doc.cn

XMPP Changes

The XMPP channel adapters now support the XMPP Extensions (XEP). See XMPP Extensions for more information.spring-doc.cn

WireTap Late Binding

The WireTap ChannelInterceptor now can accept a channelName that is resolved to the target MessageChannel later, during the first active interceptor operation. See Wire Tap for more information.spring-doc.cn

ChannelMessageStoreQueryProvider Changes

The ChannelMessageStoreQueryProvider now supports H2 databases. See Backing Message Channels for more information.spring-doc.cn

WebSocket Changes

The ServerWebSocketContainer now exposes an allowedOrigins option, and SockJsServiceOptions exposes a suppressCors option. See WebSockets Support for more information.spring-doc.cn