This chapter provides an overview of the new features and improvements that have been introduced with Spring
If you are interested in more details, see the Issue Tracker tickets that were resolved as part of the 5.1 development process.
The following components are new in 5.1:
java.util.function interfaces now have improved integration support in the Framework components.
Also Kotlin lambdas now can be used for handler and source methods.
A JUnit 5
@LongRunningTest conditional annotation is provided to check the environment or system properties for the
RUN_LONG_INTEGRATION_TESTS entry with the value of
true to determine if test should be run or skipped.
The following changes have been made in version 5.1:
IntegrationFlowContext is now an interface and
IntegrationFlowRegistration is an inner interface of
logAndReply() operator has been introduced for convenience when you wish to log at the end of a flow for request-reply configurations.
This avoid confusion with
log() which is treated as a one-way end flow component.
A generated bean name for any
NamedComponent within an integration flow is now based on the component type for better readability from visual tools, logs analyzers and metrics collectors.
GenericHandler.handle() now excepts a
MessageHeaders type for the second argument.
Exceptions caught and re-thrown by
AbstractDispatcher are now more consistent:
MessagingExceptionof any kind that has a
failedMessageproperty is re-thrown unchanged.
MessagingExceptionof any kind that has a
failedMessageproperty was re-thrown unchanged
MessagingExceptionthat had no
failedMessageproperty was wrapped in a
RuntimeExceptioninstances were re-thrown unchanged.
Global channel interceptors now apply to dynamically registered channels, such as through the
IntegrationFlowContext when using the Java DSL or beans that are initialized using
Previously, when beans were created after the application context was refreshed, interceptors were not applied.
ChannelInterceptor.postReceive() is no longer called when no message is received; it is no longer necessary to check for a
Previously, the method was called.
If you have an interceptor that relies on the previous behavior, implement
afterReceiveCompleted() instead, since that method is invoked, regardless of whether a message is received or not.
PolledJmsChannel previously did not invoke
null; they now do.
ResultType.BYTES mode is introduced for the
See the section called “JSON Transformers” for more information.
Starting with version 5.0.5, generated bean names for the components in an
IntegrationFlow include the flow bean name, followed by a dot, as a prefix. For example, if a flow bean were named
flowBean, a generated bean might be named
See Section 11.13, “Working With Message Flows” for more information.
groupTimeout is evaluated to a negative value, an aggregator now expires the group immediately.
null is considered as a signal to do nothing for the current message.
popSequence property has been introduced to allow (by default) to call a
MessageBuilder.popSequenceDetails() for the output message.
AbstractAggregatingMessageGroupProcessor returns now an
AbstractIntegrationMessageBuilder instead of the whole
Message for optimization.
See Section 8.4, “Aggregator” for more information.
Starting with version 5.1, you must explicitly turn on the
@Publisher AOP functionality by using
@EnablePublisher or by using the
<int:enable-publisher> child element on
order attributes have been added for tuning the
See Section B.1.1, “Annotation-driven Configuration with the
@Publisher Annotation” for more information.
If you are using
FileExistsMode.APPEND_NO_FLUSH you can provide a
newFileCallback that will be called when creating a new file.
This callback receives the newly created file and the message that triggered the callback.
This could be used to write a CSV header, for an example.
FileReadingMessageSource now doesn’t check and create a directory until its
start() is called.
So, if an Inbound Channel Adapter for the
autoStartup = false, there are no failures against the file system during application start up.
See Chapter 17, File Support for more information.
We have made
Timestamp header mapping changes in the
See the note near the bottom of Section 14.12, “AMQP Message Headers” for more information.
contentType header is now correctly mapped as an entry in the general headers map.
See Section 14.12.2, “contentType Header” for more information.
max-rows-per-poll property on the JDBC Inbound Channel Adapter and JDBC Outbound Gateway has been deprecated in favor of the newly introduced
JdbcMessageHandler supports now a
batchUpdate functionality when the payload of the request message is an instance of an
The indexes for the
INT_CHANNEL_MESSAGE table (for the
JdbcChannelMessageStore) have been optimized.
If you have large message groups in such a store, you may wish to alter the indexes.
See Chapter 21, JDBC Support for more information.
RotatingServerAdvice is now available to poll multiple servers and directories with the inbound channel adapters.
See Section 18.6, “Inbound Channel Adapters: Polling Multiple Servers and Directories” and Section 30.8, “Inbound Channel Adapters: Polling Multiple Servers and Directories” for more information.
Also, inbound adapter
localFilenameExpression instances can contain the
#remoteDirectory variable, which contains the remote directory being polled.
The generic type of the comparators (used to sort the fetched file list for the streaming adapters) has changed from
See Section 18.5, “FTP Streaming Inbound Channel Adapter” and Section 30.7, “SFTP Streaming Inbound Channel Adapter” for more information.
In addition, the synchronizers for inbound channel adapters can now be provided with a
This is useful when using
maxFetchSize to limit the files retrieved.
CachingSessionFactory has a new property
testSession which, when true, causes the factory to perform a
test() operation on the
Session when checking out an existing session from the cache.
The outbound gateway MPUT command now supports a message payload with a collection of files or strings. See Section 30.11, “SFTP Outbound Gateway” and Section 18.9, “FTP Outbound Gateway” for more information.
When using SSL, host verification is now enabled, by default, to prevent man-in-the-middle attacks with a trusted certificate. See Section 34.10.2, “Host Verification” for more information.
In addition the key and trust store types can now be configured on the
Since the Spring Social project has moved to end of life status, Twitter support in Spring Integration has been moved to the Extensions project. See Spring Integration Social Twitter for more information.
JmsSendingMessageHandler now provides
timeToLiveExpression options to determine respective QoS options for JMS message to send at runtime.
DefaultJmsHeaderMapper now allows to map inbound
JMSExpiration properties via setting to
JmsInboundGateway is stopped, the associated listener container is now shut down; this closes its shared connection and any consumers.
You can configure the endpoints to revert to the previous behavior.
See Chapter 23, JMS Support for more information.
Function) is now supplied with the
RequestEntity<?> as a root object for evaluation context, so request headers, method, URI and body are available for target status code calculation.
Object name key values are now quoted if they contain any characters other than those allowed in a Java identifier (or period
This has the side effect that previously "allowed" names, with such characters, will now be quoted.
It is now simpler to customize the standard Micrometer meters created by the framework. See Section 12.1.2, “Micrometer Integration” for more information.
It is now possible to add additional properties to the
IntegrationNode s via
Function<NamedComponent, Map<String, Object>> additionalPropertiesCallback on the
See Section 12.8, “Integration Graph” for more information.
The Integration global properties (including defaults) can now be printed in the logs, when a
DEBUG logic level is turned on for the
See Section E.4, “Global Properties” for more information.
@Poller annotation now provides a
receiveTimeout option for convenience.
See Section E.5.1, “Using the
@Poller Annotation” for more information.