2. What’s new in Spring Integration 5.0?

This chapter provides an overview of the new features and improvements that have been introduced with Spring Integration 5.0. If you are interested in more details, please see the Issue Tracker tickets that were resolved as part of the 5.0 development process.

2.1 New Components

2.1.1 MongoDB Outbound Gateway

The new MongoDbOutboundGateway allows you to make queries to the database on demand by sending a message to its request channel. See Section 22.6, “MongoDB Outbound Gateway” for more information.

2.2 General Changes

Spring Integration is now fully based on Spring Framework 5.0 and Project Reactor 3.0. Previous Project Reactor versions are no longer supported.

2.2.1 Core Changes

The @Poller annotation now has the errorChannel attribute for easier configuration of the underlying MessagePublishingErrorHandler. See Section F.6, “Annotation Support” for more information.

All the request-reply endpoints (based on AbstractReplyProducingMessageHandler) can now start transaction and, therefore, make the whole downstream flow transactional. See Section 8.9.6, “Transaction Support” for more information.

2.2.2 JMS Changes

Previously, Spring Integration JMS XML configuration used a default bean name connectionFactory for the JMS Connection Factory, allowing the property to be omitted from component definitions. It has now been renamed to jmsConnectionFactory, which is the bean name used by Spring Boot to auto-configure the JMS Connection Factory bean.

If your application is relying on the previous behavior, rename your connectionFactory bean to jmsConnectionFactory, or specifically configure your components to use your bean using its current name.

2.2.3 Gateway Changes

The gateway now correctly sets the errorChannel header when the gateway method has a void return type and an error channel is provided. Previously, the header was not populated. This had the effect that synchronous downstream flows (running on the calling thread) would send the exception to the configured channel but an exception on an async downstream flow would be sent to the default errorChannel instead. See Section 8.4.8, “Error Handling” for more information.

2.2.4 Mail Changes

Some inconsistencies with rendering IMAP mail content have been resolved. See the note in the Mail-Receiving Channel Adapter Section for more information.

2.2.5 Feed Changes

Instead of the com.rometools.fetcher.FeedFetcher, which is deprecated in ROME, a new Resource property has been introduced to the FeedEntryMessageSource. See Chapter 13, Feed Adapter for more information.

2.2.6 File Changes

The new FileHeaders.RELATIVE_PATH Message header has been introduced to represent relative path in the FileReadingMessageSource. See Section 14.2, “Reading Files” for more information.

The tail adapter now supports idleEventInterval to emit events when there is no data in the file during that period. See Section 14.2.6, “'Tail’ing Files” for more information.

2.2.7 (S)FTP Changes

The inbound channel adapters now have a property max-fetch-size which is used to limit the number of files fetched during a poll when there are no files currently in the local directory.

The regex and pattern filters can now be configured to always pass directories. This can be useful when using recursion in the outbound gateways. See Section 15.7, “FTP Outbound Gateway” and Section 27.10, “SFTP Outbound Gateway” for more information.

2.2.8 Integration Properties

Since version 4.3.2 a new spring.integration.readOnly.headers global property has been added to customize the list of headers which should not be copied to a newly created Message by the MessageBuilder. See Section F.5, “Global Properties” for more information.

2.2.9 Stream Changes

There is a new option on the CharacterStreamReadingMessageSource to allow it to be used to "pipe" stdin and publish an application event when the pipe is closed. See Section 29.2, “Reading from streams” for more information.

2.2.10 Barrier Changes

The BarrierMessageHandler now supports a discard channel to which late-arriving trigger messages are sent. See Section 6.8, “Thread Barrier” for more information.

2.2.11 AMQP Changes

The AMQP outbound endpoints now support setting a delay expression for when using the RabbitMQ Delayed Message Exchange plugin. See Section 11.10, “Delayed Message Exchange” for more information.

The inbound endpoints now support the Spring AMQP DirectMessageListenerContainer. See Section 11.2, “Inbound Channel Adapter” for more information.

2.2.12 HTTP Changes

The DefaultHttpHeaderMapper.userDefinedHeaderPrefix property is now an empty string by default instead of X-. See Section 17.7, “HTTP Header Mappings” for more information.

2.2.13 Aggregator Performance Changes

Aggregators now use a SimpleSequenceSizeReleaseStrategy by default, which is more efficient, especially with large groups. Empty groups are now scheduled for removal after empty-group-min-timeout. See Section 6.4, “Aggregator” for more information.

2.2.14 MQTT Changes

Inbound messages are now mapped with headers RECEIVED_TOPIC, RECEIVED_QOS and RECEIVED_RETAINED to avoid inadvertent propagation to outbound messages when an application is relaying messages.

The outbound channel adapter now supports expressions for the topic, qos and retained properties; the defaults remain the same.

See Chapter 23, MQTT Support for more information.

2.2.15 STOMP Changes

The STOMP module has been changed to use ReactorNettyTcpStompClient, based on the Project Reactor 3.0 and reactor-netty extension. The Reactor2TcpStompSessionManager has been renamed to the ReactorNettyTcpStompSessionManager according to the ReactorNettyTcpStompClient foundation.

See Chapter 28, STOMP Support for more information.