Skip to content

Spring Integration 4.2 to 4.3 Migration Guide

Artem Bilan edited this page Apr 19, 2017 · 7 revisions

Outbound Gateway within Chain

Previously, it was possible to 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 to the chain's output-channel if the gateway is the last element. This condition is now detected and disallowed. If you have such configuration, simply remove the reply-channel.

Redis Queue Inbound Gateway

The default serializer in the RedisQueueInboundGateway has been changed to a JdkSerializationRedisSerializer for compatibility with the RedisQueueOutboundGateway for client/server interaction scenarios. Previously it was (in the RedisQueueInboundGateway) a StringRedisSerializer by default; to restore that behavior provide a reference to a its bean.

Global Properties

In previous versions, the Integration property names had a typographical error (...integraton...); they have now been corrected (...integration...). So, the properties with their default values are now:

spring.integration.channels.autoCreate=true
spring.integration.channels.maxUnicastSubscribers=0x7fffffff
spring.integration.channels.maxBroadcastSubscribers=0x7fffffff
spring.integration.taskScheduler.poolSize=10
spring.integration.messagingTemplate.throwExceptionOnLateReply=false
spring.integration.messagingAnnotations.require.componentAnnotation=false

See the Reference Manual for more information.

Messaging Annotation Support and @Component

Previously, the @MessageEndpoint stereotype annotation (or any other @Component) has been required on the class level to process Messaging Annotations like @ServiceActivator, @TRansformer, @InboundChannelAdapter, @Splitter etc. from the class methods.

This caused problems when such components were detected by component scans - such as an embedded inner class in a Spring Boot application; additional beans could be declared.

This restriction has been now been removed. In rare cases, this might cause unexpected behavior in that previously ignored annotations in classes that are not components will now be detected if such classes are declared as beans.

To restore the previous Spring Integration behavior, to require a class-level annotation, you can specify the Spring Integration property spring.integration.messagingAnnotations.require.componentAnnotation as true in the spring.integration.properties file.

MailReceiver - changed result type

Previously, the MailReceiver interface receive() method returned an array of javax.mail.Message objects, now it returns an Object[]. This facilitates a new feature to map the mail message to a Message<?> with the mail headers mapped to MessageHeaders. If that option is selected, the return type is an array of Message<?>; if not it is an array of javax.mail.Message.