This chapter provides an overview of the new features and improvements that have been introduced with Spring Integration 4.0. If you are interested in more details, please see the Issue Tracker tickets that were resolved as part of the 4.0 development process.
Please be sure to also see the Migration Guide for important changes that might affect your applications. Migration guides for all versions back to 2.1 can be found on the Wiki.
The MQTT channel adapters (previously available in the Spring Integration Extensions repository) are now available as part of the normal Spring Integration distribution. See Chapter 22, MQTT Support
The @EnableIntegration annotation has been added, to permit declaration of
standard Spring Integration beans when using @Configuration classes.
See Section 2.5, “Configuration” for more information.
The @IntegrationComponentScan annotation has been added, to permit classpath
scanning for Spring Integration specific components.
See Section 2.5, “Configuration” for more information.
Message history can now be enabled with the @EnableMessageHistory annotation in a
@Configuration class; in addition the message history settings can be modified
by a JMX MBean. In addition auto-created MessageHandlers for
annotated endpoints (e.g. @ServiceActivator, @Splitter etc.)
now are also trackable by MessageHistory. For more information, see Section 8.2, “Message History”.
Messaging gateway interfaces can now be configured with the @MessagingGateway annotation.
It is an analogue of the <int:gateway/> xml element.
For more information, see Section 7.2.6, “@MessagingGateway Annotation”.
As well as the @EnableIntegration annotation mentioned above, a
a hook has been introduced to allow the
Spring Integration infrastructure beans to be configured using Spring Boot's
@EnableAutoConfiguration.
For more information see
Spring Boot - AutoConfigure.
As well as the @EnableIntegration annotation mentioned above,
the @GlobalChannelInterceptor annotation has bean introduced.
For more information, see Section 2.5, “Configuration”.
The @IntegrationConverter annotation has bean introduced,
as an analogue of <int:converter/> component.
For more information, see Section 2.5, “Configuration”.
The @EnablePublisher annotation has been added, to allow the specification of a
default-publisher-channel for @Publisher annotations.
See Section 2.5, “Configuration” for more information.
A new Redis MessageGroupStore, that is optimized for
use when backing a QueueChannel for persistence, is now
provided.
For more information, see Section 23.4.1, “Redis Channel Message Stores”.
A new Redis ChannelPriorityMessageStore is now
provided. This can be used to retrieve messages by priority.
For more information, see Section 23.4.1, “Redis Channel Message Stores”.
The IntegrationMBeanExporter can now be enabled with the @EnableIntegrationMBeanExport
annotation in a @Configuration class. For more information, see Section 8.1.7, “MBean Exporter”.
Configuration of Spring Security for message channels using @Configuration classes is
now supported by using a ChannelSecurityInterceptorFactoryBean.
For more information, see Appendix D, Security in Spring Integration.
The Redis support now provides the <outbound-gateway> component
to perform generic Redis commands using the RedisConnection#execute method.
For more information, see Section 23.8, “Redis Outbound Command Gateway”.
Core messaging abstractions (Message,
MessageChannel etc) have moved to the Spring
Framework spring-messaging module. Users who reference these
classes directly in their code will need to make changes as described in
the first section of the
Migration Guide.
The header-type attribute has been introduced for the header sub-element of the
<int-xml:xpath-header-enricher>. This attribute provides the target type for
the header value to which the result of the XPath expression evaluation will be converted.
For more information see Section 32.7, “XPath Header Enricher”.
The result-type attribute has been introduced for the <int:object-to-json-transformer>.
This attribute provides the target type for the result of object mapping to JSON.
It supports STRING (default) and NODE.
For more information see the section called “Configuring Transformer with XML”.
The DefaultJmsHeaderMapper now maps an incoming JMSPriority header to
the Spring Integration priority header. Previously priority was only
considered for outbound messages. For more information see Section 19.6, “Mapping Message Headers to/from JMS Message”.
The JMS outbound channel adapter now supports the session-transacted attribute
(default false). Previously, you had to inject a customized JmsTemplate
to use transactions. See Section 19.3, “Outbound Channel Adapter”.
The JMS inbound channel adapter now supports the session-transacted attribute
(default false). Previously, you had to inject a customized JmsTemplate
to use transactions (the adapter allowed 'transacted' in the acknowledgeMode which was
incorrect, and didn't work; this value is no longer allowed). See
Section 19.1, “Inbound Channel Adapter”.
You can now specify a MessageConverter to be used when converting
(if necessary) payloads to one of the accepted datatypes in a Datatype channel.
For more information see the section called “Datatype Channel Configuration”.
Simplified namespace support has been added to configure a
RequestHandlerRetryAdvice.
For more information see the section called “Configuring the Retry Advice”.