1. What's new in Spring Integration 2.2?

This chapter provides an overview of the new features and improvements that have been introduced with Spring Integration 2.2 If you are interested in even more detail, please take a look at the Issue Tracker tickets that were resolved as part of the 2.2 development process:

1.1 General

1.1.1 Spring 3.1

Spring Integration now uses Spring 3.1.

1.1.2 Outbound Gateways

The XML Namespace support adds the reply-timeout attribute to the following Outbound Gateways:

  • Amqp Outbound Gateway
  • File Outbound Gateway
  • Ftp Outbound Gateway
  • Sftp Outbound Gateway
  • Ws Outbound Gateway

1.1.3 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...

  • A fixed reply queue for the outbound gateway
  • HA (mirrored) queues
  • Publisher Confirms
  • Returned Messages
  • Support for Dead Letter Exchanges/Dead Letter Queues

1.1.4 RedisStore Inbound and Outbound Channel Adapters

Spring Integration now has RedisStore Inbound and Outbound Channel Adapters allowing you to write and read Message payloads to/from Redis collection(s). For more information please see Section 22.6, “RedisStore Outbound Channel Adapter” and Section 22.5, “RedisStore Inbound Channel Adapter”.

1.1.5 MongoDB Inbound and Outbound Channel Adapters

Spring Integration now has MongoDB Inbound and Outbound Channel Adapters allowing you to write and read Message payloads to/from a MongoDB document store. For more information please see Section 21.5, “MongoDB Outbound Channel Adapter” and Section 21.4, “MongoDB Inbound Channel Adapter”.

1.1.6 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 using Spring Expression Language (SpEL).

This allows you to specify the Stored Procedures to be invoked at runtime. For example, you can provide Stored Procedure names that you would like to execute via Message Headers. For more information please see Section 17.5, “Stored Procedures”.

JMX Support

The Stored Procedure components now provide basic JMX support, exposing some of their properties as MBeans:

  • Stored Procedure Name
  • Stored Procedure Name Expression
  • JdbcCallOperations Cache Statistics

1.1.7 JDBC Support - Outbound Gateway

When using the JDBC Outbound Gateway, the update query is no longer mandatory. You can now provide solely a select query using the request message as a source of parameters.

1.1.8 JDBC Support - Channel-specific Message Store Implementation

A new Message Channel-specific Message Store Implementation has been added, providing a more scalable solution using database-specific SQL queries. For more information please see: Section 17.4.2, “Backing Message Channels”.

1.1.9 File Adapter - Improved File Overwrite/Append Handling

When using the File Oubound Channel Adapter or the File Outbound Gateway, a new mode property was added. Prior to Spring Integration 2.2, target files were replaced when they existed. Now you can specify the following options:

  • REPLACE (Default)
  • FAIL

For more information please see Section 12.3.2, “Dealing with Existing Destination Files”.

1.1.10 Orderly Shutdown

A method stopActiveComponents() has been added to the IntegrationMBeanExporter. This 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.

1.1.11 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, say, retry, to an individual endpoint. The 2.2. release introduces the <request-handler-advice-chain/> to many endpoints.

In addition, 3 standard Advice classes have been provided for this purpose:

  • MessageHandlerRetryAdvice
  • MessageHandlerCircuitBreakerAdvice
  • ExpressionEvaluatingMessageHandlerAdvice

For more information, see Section 7.7, “Adding Behavior to Endpoints”.

1.1.12 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.

In addition, these features can be enabled when there is not a 'real' transaction present, by means of a PseudoTransactionManager.

For more information see Section B.3, “Transaction Synchronization”.

1.1.13 JMS Oubound Gateway Improvements

The JMS Outbound Gateway can now be configured to use a MessageListener container to receive replies. This can improve performance of the gateway.

1.1.14 object-to-json-transformer

The ObjectToJsonTransformer now sets the content-type header to application/json by default. For more information see Section 6.1, “Transformer”.

1.2 New Components

1.2.1 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:

For more information please see Chapter 18, JPA Support

1.3 Framework Refactoring