1. What's new in Spring Integration 3.0?

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

1.1 New Components

1.1.1 TCP/IP Connection Events and Connection Management

The (supplied) TcpConnections now emit ApplicationEvents (specifically TcpConnectionEvents) when connections are opened, closed, or an exception occurs. This allows applications to be informed of changes to TCP connections using the normal Spring ApplicationListener mechanism.

AbstractTcpConnection has been renamed TcpConnectionSupport; custom connections that are subclasses of this class, can use its methods to publish events. Similarly, AbstractTcpConnectionInterceptor has been renamed to TcpConnectionInterceptorSupport.

In addition, a new <int-ip:tcp-connection-event-inbound-channel-adapter/> is provided; by default, this adapter sends all TcpConnectionEvents to a Channel.

Further, the TCP Connection Factories, now provide a new method getOpenConnectionIds(), which returns a list of identifiers for all open connections; this allows applications, for example, to broadcast to all open connections.

Finally, the connection factories also provide a new method closeConnection(String connectionId) which allows applications to explicitly close a connection using its ID.

For more information see Section 16.5, “TCP Connection Events”.

1.1.2 Syslog Support

Building on the 2.2 SyslogToMapTransformer Spring Integration 3.0 now introduces UDP and TCP inbound channel adapters especially tailored for receiving SYSLOG messages. For more information, see Chapter 27, Syslog Support.

1.1.3 'Tail' Support

File 'tail'ing inbound channel adapters are now provided to generate messages when lines are added to the end of text files. Section 12.2.1, “'Tail'ing Files”.

1.2 General Changes

1.2.1 Aggregator 'empty-group-min-timeout' property

AbstractCorrelatingMessageHandler provides a new property empty-group-min-timeout to allow empty group expiry to run on a longer schedule than expiring partial groups. Empty groups will not be removed from the MessageStore until they have not been modified for at least this number of milliseconds. For more information see Section 5.4.4, “Configuring an Aggregator”.

1.2.2 Advising Filters

Previously, when a <filter/> had a <request-handler-advice-chain/>, the discard action was all performed within the scope of the advice chain (including any downstream flow on the discard-channel). The filter element now has an attribute discard-within-advice (default true), to allow the discard action to be performed after the advice chain completes. See Section 7.7.3, “Advising Filters”.

1.2.3 ObjectToStringTransformer Improvements

This transformer now correctly transforms byte[] and char[] payloads to String. For more information see Section 6.1, “Transformer”.

1.2.4 Web Service Outbound URI Configuration

Web Service Outbound Gateway 'uri' attribute now supports <uri-variable/> substitution for all URI-schemes supported by Spring Web Services. For more information see Section 29.4, “Outbound URI Configuration”.

1.2.5 (S)FTP(S) Inbound Adapters

Previously, there was no way to override the default filter used to process files retrieved from a remote server. The filter attribute determines which files are retrieved but the FileReadingMessageSource uses an AcceptOnceFileListFilter. This means that if a new copy of a file is retrieved, with the same name as a previously copied file, no message was sent from the adapter.

With this release, a new attribute local-filter allows you to override the default filter, for example with an AcceptAllFileListFilter, or some other custom filter.

For users that wish the behavior of the AcceptOnceFileListFilter to be maintained across JVM executions, a custom filter that retains state, perhaps on the file system, can now be configured.

1.2.6 (S)FTP(S) Gateways

The gateways now support the mv command, enabling the renaming of remote files.

1.2.7 JDBC Message Store Improvements

Spring Integration 3.0 adds a new set of DDL scripts for MySQL version 5.6.4 and higher. Now MySQL supports fractional seconds and is thus improving the FIFO ordering when polling from a MySQL-based Message Store. For more information, please see Section 17.4.1, “The Generic JDBC Message Store”.

1.2.8 Jackson Support (JSON)

A new abstraction for JSON conversion has been introduced. Implementations for Jackson 1.x and Jackson 2 are currently provided, with the version being determined by presence on the classpath. Previously, only Jackson 1.x was supported. For more information, see 'JSON Transformers' in Section 6.1, “Transformer”.

1.2.9 HTTP Outbound Endpoint 'encode-uri' property

<http:outbound-gateway/> and <http:outbound-channel-adapter/> now provide an encode-uri attribute to allow disabling the encoding of the URI object before sending the request. For more information see Chapter 15, HTTP Support.

1.2.10 AMQP Outbound Gateway Header Mapping

Previously, the <int-amqp:outbound-gateway/> mapped headers before invoking the message converter, and the converter could overwrite headers such as content-type. The outbound adapter maps the headers after the conversion, which means headers like content-type from the outbound Message (if present) are used.

Starting with this release, the gateway now maps the headers after the message conversion, consistent with the adapter. If your application relies on the previous behavior (where the converter's headers overrode the mapped headers), you either need to filter those headers (before the message reaches the gateway) or set them appropriately. The headers affected by the SimpleMessageConverter are content-type and content-encoding. Custom message converters may set other headers.

1.2.11 Chain Elements 'id' Attribute

Previously, the id attribute for elements within a <chain> was ignored and, in some cases, disallowed. Now, the id attribute is allowed for all elements within a <chain>. The bean names of chain elements is a combination of the surrounding chain's id and the id of the element itself. For example: 'fooChain$child.fooTransformer.handler'. For more information see Section 5.6, “Message Handler Chain”.