-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Spring Integration 4.3 to 5.0 Migration Guide
The closableResource typo in the IntegrationMessageHeaderAccessor.CLOSEABLE_RESOURCE constant value has been fixed to the proper closeableResource.
If application doesn't use IntegrationMessageHeaderAccessor.CLOSEABLE_RESOURCE to access to an appropriate header, it is recommended to review any closableResource typo usage.
JMS components can be configured using XML with no connection factory property; the framework uses a default bean name.
Prior to version 5.0, this default bean name was connectionFactory.
In order to align with Spring Boot's auto configuration, which configures a bean called jmsConnectionFacrory, Spring Integration now uses that bean name as the default.
If your application relied on the previous behavior, you will need to rename your bean to jmsConnectionFactory or change the component definitions to explicitly reference your bean.
The Reactor 2.0 isn't supported any more.
The Messaging Gateway Promise return type from Reactor 2.0 has been replaced with the Mono type from Reactor 3.0.
For all the Reactive Streams changes for new Mono type, please, refer to the Reactor Project Site.
The Spring Integration Java DSL has been merged to the Core project with Java 8 code base.
The old project remains for the previous Spring Integration versions and isn't compatible with version 5.0.
Although the project has been generally merged, some changes have happened:
-
All the classes from
org.springframework.integration.dsl.coretoorg.springframework.integration.dsl. -
From
org.springframework.integration.dsl.support:
- the Java 8 functions (
Consumer,Functionetc.) have been removed in favor ofjava.util.functionpackage classes -
Transformersto theorg.springframework.integration.dsl; -
BeanNameMessageProcessorto theorg.springframework.integration.handler; -
FunctionExpressionto theorg.springframework.integration.expression; -
GenericHandlerto theorg.springframework.integration.handler; -
MapBuilder,StringStringMapBuilderandPropertiesBuilderto theorg.springframework.integration.support; -
MessageProcessorMessageSourceto theorg.springframework.integration.endpoint;
-
org.springframework.integration.dsl.support.tupleclasses have been replaced for usage for similar from the packagereactor.util.function, which is now mandatory dependency Reactor3.0. -
Classes
DslIntegrationConfigurationInitializerandIntegrationFlowBeanPostProcessorfrom the packageorg.springframework.integration.dsl.confighave been moved to theorg.springframework.integration.config.dsl. -
Classes
TransactionHandleMessageAdviceandTransactionInterceptorBuilderfrom the packageorg.springframework.integration.dsl.transactionhave been moved to theorg.springframework.integration.transaction.
All the protocol-specific Java DSL components, e.g. Jms and Jpa factories, have been moved to the appropriate Spring Integration Modules with straightforward package rename.
For example classes from the org.springframework.integration.dsl.mail package are now in the spring-integration-mail module and in the package org.springframework.integration.mail.dsl.
The org.springframework.integration.dsl.kafka content is now located in the Spring Integration Kafka extension project, in version 3.0 in the package org.springframework.integration.kafka.dsl.
-
The protocol-specific factory methods in the
Channels(e.g.amqp(ConnectionFactory connectionFactory)) have been removed in favor of appropriate factory methods in the target DSL components factory. For examplejmsPollable()is now likeJms.pollableChannel(). -
The protocol-specific factory methods in the
Transformers(e.g.fromMail()) have been removed in favor of appropriate factory methods in the target DSL components factory. For examplefileToString()is now likeFiles.toStringTransformer(). -
The
IntegrationFlowDefinition.handleWithAdapter(), together with itsAdaptersfactory, has been removed to avoid modules tangle. Now you have to use target DSL components factory directly, for example:
.handle(Files.outboundGateway(m -> m.getHeaders().get("directory")))instead of:
.handleWithAdapter(a -> a.fileGateway(m -> m.getHeaders().get("directory")))The Reactor2TcpStompSessionManager has been renamed to the ReactorNettyTcpStompSessionManager and it is based on a new ReactorNettyTcpStompClient from Spring Framework 5.0.
Reactor 2.x components aren't supported any more.
The DefaultAmqpHeaderMapper now maps the AmqpHeaders.CORRELATION_ID (amqp_correlationId) to/from String. Previously, it mapped to/from byte[].
The FlushPredicate and MessageFlushPredicate have an addition parameter firstWrite - the time a new (or previously closed) file was first written to.
The pollable channel now blocks the poller thread for the specified receiveTimeout (default 1 second).
Previously, unlike other PollableChannels, the thread returned immediately to the scheduler if no message was available, regardless of the receive timeout.
Blocking is a little more expensive than just using a basicGet() to retrieve a message (with no timeout) because a consumer has to be created to receive each message.
To restore the previous behavior, set the poller receiveTimeout to 0.