Skip to content

Spring Integration 3.0 to 4.0 Migration Guide

Gary Russell edited this page Mar 16, 2014 · 24 revisions

Core classes/interfaces from Spring Integration have been moved to Spring Framework 4.0.

Users with direct references to the following classes, in order to migrate to Spring Integration 4.0 will need to change import statements to reflect these changes.

Users who do not reference framework classes from their own (POJO) code, and use the integration namespace to configure their components will need no changes.

The following classes have been moved

from org.springframework.integration to org.springframework.messaging:

  • Message
  • MessageChannel
  • MessageHandler
  • MessageHeaders
  • PollableChannel
  • SubscribableChannel
  • MessagingException
  • MessageHandlingException
  • MessageDeliveryException

from org.springframework.integration.core to org.springframework.messaging:

  • MessageHandler
  • MessagePostProcessor

from org.springframework.integration.channel.interceptor to org.springframework.messaging.support:

  • ChannelInterceptorAdapter

from org.springframework.integration.message to org.springframework.messaging.support:

  • ErrorMessage
  • GenericMessage

In addition, MessageHeaders constanct have been moved to MessageHeaderAccessor (for common spring-messaging headers, e.g ID) and IntegrationMessageHeaderAccessor (for Spring Integration headers, e.g. SEQUENCE_SIZE). Message header accessors provide convenient typed accessor methods for these headers.

##Spring Integration Global Properties

Spring Integration starting with version 3.0 introduced global options, which can be changed using META-INF/integration.properties file or integrationGlobalProperties bean. Since version 4.0 those properties have been enriched with spring.integraton. prefix. Here is a list of all supported global options with their default values:

spring.integraton.channels.autoCreate=true
spring.integraton.channels.maxUnicastSubscribers=0x7fffffff
spring.integraton.channels.maxBroadcastSubscribers=0x7fffffff
spring.integraton.taskScheduler.poolSize=10
spring.integraton.messagingTemplate.throwExceptionOnLateReply=false

JSON transformers

The backward compatibility for object-mapper option of the <object-to-json-transformer/> and <json-to-object-transformer/> components has beed removed. Now they support only reference to the org.springframework.integration.support.json.JsonObjectMapper impementation.