Skip to content

Spring Integration 5.0 to 5.1 Migration Guide

Artem Bilan edited this page Oct 8, 2018 · 16 revisions

Table of Contents

Class and Package Tangles

  • move StaticMessageHeaderAccessor to root integration package
  • move acknowledgment related classes to a new acks package
  • move MMIH to handler.support, alongside argument resolvers, also HandlerMethodArgumentResolversHolder
  • move ErrorMessagePublisher to core
  • move PatternMatchUtils to support.utils
  • move MessageSourceManagement to support.management
  • remove direct reference to MicrometerMetricsCapter from IntegrationManagementSupport
  • add new class MetricsCaptorLoader
  • move OperationsCallback to inner interface in RemoteFileOperations
  • move HttpContextUtils to config
  • move IntegrationManagementConfigurer from management to config
  • make graph a top-level package
  • move classes from config.dsl package to dsl one
  • rename core event package to events

IntegrationFlowContext

The IntegrationFlowContext is now an interface and IntegrationFlowRegistration is an inner interface of the IntegrationFlowContext.

Dispatcher Exceptions

Exceptions caught and re-thrown by AbstractDispatcher are now more consistent:

  • A MessagingException of any kind, with a failedMessage property, is re-thrown unchanged
  • All other exceptions are wrapped in a MessageDeliveryException with the failedMessage property set

Previously:

  • A MessagingException of any kind, with a failedMessage property, was re-thrown unchanged
  • A MessagingException, with no failedMessage property, was wrapped in a MessagingException with the failedMessage property set
  • Other RuntimeException s were re-thrown unchanged
  • Checked exceptions were wrapped in a MessageDeliveryException with the failedMessage property set

Integration Evaluation Context Bean

An integrationSimpleEvaluationContext bean for the SimpleEvaluationContext is now registered along with the integrationEvaluationContext bean for the StandardEvaluationContext. Therefore an injection for the EvaluationContext should be reconsidered for the appropriate bean to use.

Gemfire Module

Right now this module is based on the Open Source Spring Data for Apache Geode project as transitive dependency. To switch to the commercial Pivotal GemFire based Spring Data for Pivotal GemFire, exclude spring-data-geode from dependencies and add spring-data-gemfire:

<dependency>
    <groupId>org.springframework.integration</groupId>
    <artifactId>spring-integration-gemfire</artifactId>
    <exclusions>
        <exclusion>
            <groupId>org.springframework.data</groupId>
            <artifactId>spring-data-geode</artifactId>
        </exclusion>
    </exclusions>
</dependency>

<dependency>
    <groupId>org.springframework.data</groupId>
    <artifactId>spring-data-gemfire</artifactId>
</dependency>

AMQP contentType Header Mapping

The contentType header is no longer incorrectly mapped as an entry in the MessageProperties.headers map; it is only mapped to the MessageProperties.contentType property (which is represented as content_type in RabbitMQ). Previously the header was mapped in both places.

Aggregator group timeout

Now a negative groupTimeout results in the immediate group expiration functionality without any scheduling. Only the null result of the groupTimeout calculation is treated as like "do nothing" for the current message to process.

@Publisher annotation processing

Now to enable a @Publisher annotation AOP proxying, the @EnablePublisher must be declared on some @Configuration class. The work which is done by the PublisherAnnotationBeanPostProcessor to scan classes for the @Publisher annotation is too heavy, so the Framework doesn't register it by default any more. With the XML configuration, for the same purpose, the <int:enable-publisher> sub-element must be declared on the <int:annotation-config>.

Streaming Remote File Source Comparators

Comparators used to sort remote file lists for streaming inbound channel adapters are now applied to the raw object representing the remote file, rather than an AbstractFileInfo object. e.g. for FTP, use Comparator<FTPFile> and for SFTP, use Comparator<LsEntry>.

GenericHandler and MessageHeaders

The GenericHandler.handle() now expects a MessageHeaders type for the second argument instead of plain Map<String, Object>. This is done for better end-user experience, especially for type-safe retrieval. The existing lambdas in the Java DSL's .handle() is fully compatible. Only direct GenericHandler interface implementations have to be changed accordingly a new API.

Clone this wiki locally