Skip to content

Spring Integration 2.1 to 2.2 Migration Guide

artembilan edited this page Jun 21, 2012 · 29 revisions

###spring-integration-remote Session Interface

The interface is used by FTP and SFTP modules; in 2.2 a new method was added

String[] listNames(String path);

This method was introduced in 2.1.1 on a temporary sub-interface

ExtendedSession<F>

to avoid breaking any user implementations.

This interface has now been removed and the method moved to

Session<F>

Any user Session implementations must implement this method, to return a simple array of Strings, containing the file names matched to the path. This method is used by the mget command.

###TCP Default Socket Timeout

Previously, when using a client connection factory with both outbound and inbound adapters, sockets created by that factory would get a default socket timeout of 10 seconds. This could be overridden by specifying a large timeout (2.0) or 0 (2.1).

In 2.2 and above, these sockets now get a default timeout of 0 (infinity). If you wish to restore the previous behavior, explicitly set the so-timeout attribute to 10000.

Note that single-use sockets created by a server connection factory continue to be configured with the default of 10 seconds if the so-timeout attribute is not configured.

###TCP Thread Pools with NIO

Previously, it was possible to hit an irrecoverable deadlock when using fixed thread pools (executors) when using NIO connections. This was more likely to happen when the pool was very small (just a few threads) or under very extreme conditions.

With the 2.2. release, we have added deadlock detection which will cause a connection to eventually fail if a thread is not available to handle the request, rather than hanging indefinitely. This type of thread starvation was a rare occurrence; we only had one user experience it when he set the pool size to just 2.

However, by necessity, the deadlock detection logic causes extra threads to be used at times, and so may require users with fixed thread pools, who haven't seen the issue, to slightly increase the pool size. Or, alternatively, use a cached thread pool, instead of a fixed thread pool.

You will immediately know if this situation has occurred if you see the following message:

"Timed out writing to pipe, probably due to insufficient threads in a fixed thread pool; consider increasing this task executor pool size"

###TCP Outbound Gateway reply-timeout (Milestone 3)

This attribute has been changed to be consistent with other gateways; it now reflects the time the gateway will wait to send the reply to the reply-channel, once it has been received. It only applies when the reply-channel might block (such as a bounded queue channel that is full).

A new attribute remote-timeout replaces the previous use of reply-timeout. This is the time the gateway will wait for a reply from the remote system.

For backwards compatibility, if just the reply-timeout is set, the remote-timeout will be set to the same value.

###ResequencingMessageGroupProcessor (Milestone 3)

Removed setComparator(..) method. See details in https://jira.springsource.org/browse/INT-2518

###HttpRequestExecutingMessageHandler (HTTP Outbound Gateway) (Milestone 3)

Changed the default response type from HttpStatus to org.springframework.http.ResponseEntity for more flexibility

###TCP ip_connection_seq Header Removed (Milestone 3)

Previously, this header (IpHeaders.CONNECTION_SEQ) was deprecated in favor of the standard sequenceNumber header, enabled by setting applySequence on the connection factory.

This header has now been removed; users relying on it should set applySequence and use the sequenceNumber header.

###Changes to LoadBalancingStrategy

TBS

###Delayer's changes (Milestone 3)

Now delayer has ability to reschedule persisted Messages after the application restart. It caused such a change:

  • id attribute of <delayer> element is required. It is used with suffix '.messageGroupId' as Message Group identificator ot store delayed Messages in the MessageGroupStore
  • default-delay requirement was removed: it's '0' by default. However one of (or both) default-delay and delay-header-name should be declared
  • wait-for-tasks-to-complete-on-shutdown was remove, as it is a property of provided ThreadPoolTaskScheduler
  • added JMX support for DelayHandler to control rescheduling of delayed persisted Messages