Skip to content

Spring Integration 2.0 to 2.1 Migration Guide

ghillert edited this page Jan 3, 2012 · 44 revisions

Spring Integration 2.0 to 2.1 Migration Guide

For reference see: https://jira.springsource.org/browse/INT-2324

Dependencies

Spring

Spring Integration 2.1 now depends (As a minimum) on Spring 3.0.7.RELEASE. Spring Integration 2.1 will also work with Spring 3.1.0.RELEASE.

Dependency Changes Matrix

The following dependencies were updated between Spring Integration 2.0.5.RELEASE and 2.1:

Dependency Old Version New Version
Commons Net 2.0 3.0.1
Jackson 1.4.3 1.8.3
Spring 3.0.5.RELEASE 3.0.7.RELEASE
Spring Security 3.0.5.RELEASE 3.1.0.RELEASE
Spring Web Services 2.0.2.RELEASE 2.0.3.RELEASE
Groovy 1.7.5 1.8.4
JSch 0.1.42 0.1.45

The Spring Integration Twitter Module now uses Spring Social 1.0.1.RELEASE, instead of Twitter4j.

XML Schema Changes

Spring Integration 2.1 ships with an updated version 2.1 XML Schema. Users must make sure to use either version-less XML Spring Integration namespaces or to use the 2.1 XML namespace. If you try to use a Spring Integration 2.1 based application with the old 2.0 or 1.0 XML namespace, an exception will be thrown:

Poller Changes

The following previously deprecated attributes were removed in Spring Integration 2.1:

  • cron-trigger
  • interval-trigger

Channel Changes

The dispatcher attribute is DEPRECATED. Please use the dispatcher sub-element instead.

FTP and SFTP Module Changes

The cache-sessions XML attribute has been deprecated. Consider wrapping your SessionFactory in an instance of org.springframework.integration.file.remote.session.CachingSessionFactory instead.

HTTP Module Changes

For the inbound-channel-adapter the name XML attribute has been deprecated. Use the path attribute if you want to specify the path or the id attribute if you simply want to identify this component instead.

JMS Module Changes

The delivery-mode XML attribute is deprecated and maybe removed in future Spring Integration versions. Please use the delivery-persistent XML attribute instead.

Mail Module

On the "imap-idle-channel-adapter" component, the task-executor attribute was removed.

XML Module

The xpath-selector element is deprecated as of Spring Integration 2.1. Please use an xpath-filter instead.

Removed Module

The 'spring-integration-httpinvoker' module, which was deprecated in version 2.0, has been removed with Spring Integration 2.1.

Removed Classes

Removed and/or renamed Methods

Deprecations

XMPP Module

In org.springframework.integration.xmpp.core.AbstractXmppConnectionAwareEndpoint the setter setRequestChannel is deprecated and will be removed in future versions. Please use setOutputChannel instead.

In org.springframework.integration.xmpp.XmppHeaders the following 2 constants are deprecated:

  • Constant CHAT_TO is deprecated. Use the TO Header Constant instead.
  • Constant CHAT_THREAD_ID is deprecated. Use the **THREAD Header Constant instead.

Functional Changes

Routers

Since Spring Integration 2.1 the ignore-channel-name-resolution-failures attribute is removed in favor of consolidating its behavior with the resolution-required attribute. Also, the resolution-required attribute now defaults to true. Prior to these changes, the resolution-required attribute defaulted to false causing messages to be silently dropped when no channel was resolved and no default-output-channel was set. The new behavior will require at least one resolved channel and by default will throw a MessageDeliveryException if no channel was determined (or an attempt to send was not successful).

Other Router Changes

Anyone extending AbstractMessageRouter might need to modify code now that there is a new level for AbstractMappingMessageRouter which also renamed getChannelIdentifiers() to getChannelMappings(). That method is now only needed for mapping router extensions though.

Routers that are not mapping routers (That do not extend org.springframework.integration.router.AbstractMappingMessageRouter), need to implement determineTargetChannels (returning null if the desire is to route to the discard channel).

If you desire to drop messages silently simply set:

default-output-channel="nullChannel"

Deprecations

The channel-resolver XML attribute has been deprecated and may be removed in a future version. However, please be aware that the underlying property on the org.springframework.integration.router.AbstractMappingMessageRouter is NOT deprecated. It is considered an infrastructural configuration option and as of 2.1. Therefore, it has only been deprecated as a configuration-driven attribute.

Chain

Handlers within a chain are no longer registered as beans, and therefore would not be exposed directly as MBeans (the chain is effectively a black box)

Clone this wiki locally