See the Migration Guide for important changes that might affect your applications. You can find migration guides for all versions back to 2.1 on the wiki.spring-doc.cn

New Components

Version 2.2 added a number of new components.spring-doc.cn

RedisStore Inbound and Outbound Channel Adapters

Spring Integration now has RedisStore Inbound and Outbound Channel Adapters, letting you write and read Message payloads to and from Redis collections. For more information, see RedisStore Outbound Channel Adapter and Redis Store Inbound Channel Adapter.spring-doc.cn

MongoDB Inbound and Outbound Channel Adapters

Spring Integration now has MongoDB inbound and outbound channel adapters, letting you write and read Message payloads to and from a MongoDB document store. For more information, see MongoDB Outbound Channel Adapter and MongoDB Inbound Channel Adapter.spring-doc.cn

JPA Endpoints

Spring Integration now includes components for the Java Persistence API (JPA) for retrieving and persisting JPA entity objects. The JPA Adapter includes the following components:spring-doc.cn

For more information, see JPA Support.spring-doc.cn

General Changes

This section describes general changes from version 2.1 to version 2.2.spring-doc.cn

Spring 3.1 Used by Default

Spring Integration now uses Spring 3.1.spring-doc.cn

Adding Behavior to Endpoints

The ability to add an <advice-chain/> to a poller has been available for some time. However, the behavior added by this affects the entire integration flow. It did not address the ability to add (for example) retry to an individual endpoint. The 2.2 release introduced the <request-handler-advice-chain/> to many endpoints.spring-doc.cn

In addition, we added three standard advice classes for this purpose:spring-doc.cn

For more information, see Adding Behavior to Endpoints.spring-doc.cn

Transaction Synchronization and Pseudo Transactions

Pollers can now participate in Spring’s Transaction Synchronization feature. This allows for synchronizing such operations as renaming files by an inbound channel adapter, depending on whether the transaction commits or rolls back.spring-doc.cn

In addition, you can enable these features when no “real” transaction is present, by means of a PseudoTransactionManager.spring-doc.cn

For more information, see Transaction Synchronization.spring-doc.cn

File Adapter: Improved File Overwrite and Append Handling

When using the file outbound channel adapter or the file outbound gateway, you can use a new mode property. Prior to Spring Integration 2.2, target files were replaced when they existed. Now you can specify the following options:spring-doc.cn

Reply-Timeout Added to More Outbound Gateways

The XML Namespace support adds the reply-timeout attribute to the following outbound gateways:spring-doc.cn

Spring-AMQP 1.1

Spring Integration now uses Spring AMQP 1.1. This enables several features to be used within a Spring Integration application, including the following:spring-doc.cn

JDBC Support - Stored Procedures Components

SpEL Support

When using the stored procedure components of the Spring Integration JDBC Adapter, you can now provide stored procedure names or stored function names by using the Spring Expression Language (SpEL).spring-doc.cn

Doing so lets you specify the stored procedures to be invoked at runtime. For example, you can provide stored procedure names that you would like to execute through message headers. For more information, see Stored Procedures.spring-doc.cn

JMX Support

The stored procedure components now provide basic JMX support, exposing some of their properties as MBeans:spring-doc.cn

JDBC Support: Outbound Gateway

When you use the JDBC outbound gateway, the update query is no longer mandatory. You can now provide only a select query by using the request message as a source of parameters.spring-doc.cn

JDBC Support: Channel-specific Message Store Implementation

We added a new message channel-specific message store implementation, providing a more scalable solution using database-specific SQL queries. For more information, see Backing Message Channels.spring-doc.cn

Orderly Shutdown

We added a method called stopActiveComponents() to the IntegrationMBeanExporter. It allows a Spring Integration application to be shut down in an orderly manner, disallowing new inbound messages to certain adapters and waiting for some time to allow in-flight messages to complete.spring-doc.cn

JMS Outbound Gateway Improvements

You can now configure the JMS outbound gateway to use a MessageListener container to receive replies. Doing so can improve performance of the gateway.spring-doc.cn

ObjectToJsonTransformer

By default, the ObjectToJsonTransformer now sets the content-type header to application/json. For more information, see Transformer.spring-doc.cn

HTTP Support

Java serialization over HTTP is no longer enabled by default. Previously, when setting an expected-response-type on a Serializable object, the Accept header was not properly set up. We updated the SerializingHttpMessageConverter to set the Accept header to application/x-java-serialized-object. However, because this could cause incompatibility with existing applications, we decided to no longer automatically add this converter to the HTTP endpoints.spring-doc.cn

If you wish to use Java serialization, you need to add the SerializingHttpMessageConverter to the appropriate endpoints by using the message-converters attribute (when you use XML configuration) or by using the setMessageConverters() method (in Java).spring-doc.cn

Alternatively, you may wish to consider using JSON instead. It is enabled by having Jackson on the classpath.spring-doc.cn