1. What's new in Spring Integration 4.0?

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.

1.1 New Components

1.1.1 MQTT Channel Adapters

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

1.1.2 @EnableIntegration

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.

1.1.3 @IntegrationComponentScan

The @IntegrationComponentScan annotation has been added, to permit classpath scanning for Spring Integration specific components. See Section 2.5, “Configuration” for more information.

1.1.4 @EnableMessageHistory

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”.

1.1.5 @MessagingGateway

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”.

1.1.6 Spring Boot @EnableAutoConfiguration

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.

1.1.7 @GlobalChannelInterceptor

As well as the @EnableIntegration annotation mentioned above, the @GlobalChannelInterceptor annotation has bean introduced. For more information, see Section 2.5, “Configuration”.

1.1.8 @IntegrationConverter

The @IntegrationConverter annotation has bean introduced, as an analogue of <int:converter/> component. For more information, see Section 2.5, “Configuration”.

1.1.9 @EnablePublisher

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.

1.1.10 Redis Channel Message Stores

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”.

1.1.11 @EnableIntegrationMBeanExport

The IntegrationMBeanExporter can now be enabled with the @EnableIntegrationMBeanExport annotation in a @Configuration class. For more information, see Section 8.1.7, “MBean Exporter”.

1.1.12 ChannelSecurityInterceptorFactoryBean

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.

1.1.13 Redis Command Gateway

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”.

1.2 General Changes

1.2.1 Requires Spring Framework 4.0

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.

1.2.2 Header Type for XPath Header Enricher

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”.

1.2.3 Object To Json Transformer: Node Result

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”.

1.2.4 JMS Header Mapping

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”.

1.2.5 JMS Outbound Channel Adapter

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”.

1.2.6 JMS Inbound 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”.

1.2.7 Datatype Channels

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”.

1.2.8 Simpler Retry Advice Configuration

Simplified namespace support has been added to configure a RequestHandlerRetryAdvice. For more information see the section called “Configuring the Retry Advice”.