Start 6.0 version

* Upgrade to Java 17, SF-6.0, Gradle 7.2
* Upgrade to Jakarta dependencies and respective namespaces
* Fix some tests for Java 17 compatibility
* Fix wrong Javadocs
* Add some missed Javadocs
* Fix more `jakarta` namespace
* Fix WS & XML modules to use Jakarta EE
* `--add-opens` in some modules for their reflection-based tests
* Disable Kafka tests which does not work on Windows; see Apache Kafka `3.0.1`
* Upgrade to JUnit `5.8.1`
* Migrate JMS tests to Artemis
* Remove RMI module as it was deprecated before
* Fix `pr-build-workflow.yml` for Java 17
* Fix JavaDocs warnings using `Xdoclint:syntax` per module, not in the top-level `api` task
* Move docs for version `6.0`
This commit is contained in:
Artem Bilan
2021-11-03 09:38:10 -04:00
parent 4423e43cd8
commit a80b22638d
225 changed files with 2196 additions and 2628 deletions

View File

@@ -103,7 +103,7 @@
<property name="processJavadoc" value="true"/>
</module>
<module name="ImportOrder">
<property name="groups" value="java,/^javax?\./,org,org.springframework,*"/>
<property name="groups" value="java,/^javax?\./,/^jakarta?\./,org,org.springframework,*"/>
<property name="ordered" value="true"/>
<property name="separated" value="true"/>
<property name="option" value="top"/>

View File

@@ -417,12 +417,6 @@ Previously, when configuring a `<message-driven-channel-adapter/>`, if you wishe
We added the `task-executor`, letting it be set directly on the adapter.
This is in addition to several other container attributes that were already available.
[[x3.0-rmi-ec]]
===== RMI Inbound Gateway
The RMI Inbound Gateway now supports an `error-channel` attribute.
See <<./rmi.adoc#rmi-inbound,Inbound RMI>>.
[[x3.0-xslt-transformer]]
===== `XsltPayloadTransformer`

View File

@@ -66,13 +66,6 @@ See <<./ip.adoc#ip-collaborating-adapters,Collaborating Channel Adapters>> and <
The UDP channel adapters can now be configured with a `SocketCustomizer` which allows the setting of socket properties that are not directly supported by the adapters.
See <<./ip.adoc#udp-adapters,UDP Adapters>> for more information.
[[x5.4-rmi]]
=== RMI Changes
The `spring-integration-rmi` module is deprecated with no replacement and is going to be removed in the next major version.
See <<./rmi.adoc#rmi, RMI Support>> for more information.
[[x5.4-amqp]]
=== AMQP Changes

View File

@@ -0,0 +1,113 @@
[[migration-5.4-5.5]]
=== Changes between 5.4 and 5.5
[[x5.5-new-components]]
=== New Components
[[x5.5-file-aggregator]]
==== File Aggregator
A `FileSplitter.FileMaker`-based implementation of `CorrelationStrategy`, `ReleaseStrategy` and `MessageGroupProcessor` as a `FileAggregator` component was introduced.
See <<./file.adoc#file-aggregator, File Aggregator>> for more information.
[[x5.5-mqtt-v5]]
==== MQTT v5 Support
The `Mqttv5PahoMessageDrivenChannelAdapter` and `Mqttv5PahoMessageHandler` (including respective `MqttHeaderMapper`) were introduced to support MQTT v5 protocol communication.
See <<./mqtt.adoc#mqtt-v5, MQTT v5 Support>> for more information.
[[x5.5-general]]
=== General Changes
All the persistent `MessageGroupStore` implementation provide a `streamMessagesForGroup(Object groupId)` contract based on the target database streaming API.
See <<./message-store.adoc#message-store,Message Store>> for more information.
The `integrationGlobalProperties` bean (if declared) must be now an instance of `org.springframework.integration.context.IntegrationProperties` instead of `java.util.Properties`, which support is deprecated for backward compatibility.
The `spring.integration.channels.error.requireSubscribers=true` global property is added to indicate that the global default `errorChannel` must be configured with the `requireSubscribers` option (or not).
The `spring.integration.channels.error.ignoreFailures=true` global property is added to indicate that the global default `errorChannel` must ignore (or not) dispatching errors and pass the message to the next handler.
See <<./configuration.adoc#global-properties,Global Properties>> for more information.
An `AbstractPollingEndpoint` (source polling channel adapter and polling consumer) treats `maxMessagesPerPoll == 0` as to skip calling the source.
It can be changed to different value later on, e.g. via a Control Bus.
See <<./endpoint.adoc#endpoint-pollingconsumer,Polling Consumer>> for more information.
The `ConsumerEndpointFactoryBean` now accept a `reactiveCustomizer` `Function` to any input channel as reactive stream source and use a `ReactiveStreamsConsumer` underneath.
This is covered as a `ConsumerEndpointSpec.reactive()` option in Java DSL and as a `@Reactive` nested annotation for the messaging annotations.
See <<./reactive-streams.adoc#reactive-streams,Reactive Streams Support>> for more information.
The `groupTimeoutExpression` for a correlation message handler (an `Aggregator` and `Resequencer`) can now be evaluated to a `java.util.Date` for some fine-grained scheduling use-cases.
Also the `BiFunction groupConditionSupplier` option is added to the `AbstractCorrelatingMessageHandler` to supply a `MessageGroup` condition against a message to be added to the group.
See <<./aggregator.adoc#aggregator,Aggregator>> for more information.
The `MessageGroup` abstraction can be supplied with a `condition` to evaluate later on to make a decision for the group.
See <<./message-store.adoc#message-group-condition,Message Group Condition>> for more information.
[[x5.5-integration-flows-composition]]
==== Integration Flows Composition
The new `IntegrationFlows.from(IntegrationFlow)` factory method has been added to allow starting the current `IntegrationFlow` from the output of an existing flow.
In addition, the `IntegrationFlowDefinition` has added a `to(IntegrationFlow)` terminal operator to continue the current flow at the input channel of some other flow.
See <<./dsl.adoc#integration-flows-composition,Integration Flows Composition>> for more information.
[[x5.5-amqp]]
==== AMQP Changes
The `AmqpInboundChannelAdapter` and `AmqpInboundGateway` (and the respective Java DSL builders) now support an `org.springframework.amqp.rabbit.retry.MessageRecoverer` as an AMQP-specific alternative to the general purpose `RecoveryCallback`.
See <<./amqp.adoc#amqp,AMQP Support>> for more information.
[[x5.5-redis]]
==== Redis Changes
The `ReactiveRedisStreamMessageProducer` has now setters for all the `StreamReceiver.StreamReceiverOptionsBuilder` options, including an `onErrorResume` function.
See <<./redis.adoc#redis,Redis Support>> for more information.
[[x5.5-http]]
==== HTTP Changes
The `HttpRequestExecutingMessageHandler` doesn't fallback to the `application/x-java-serialized-object` content type any more and lets the `RestTemplate` make the final decision for the request body conversion based on the `HttpMessageConverter` provided.
It also has now an `extractResponseBody` flag (which is `true` by default) to return just the response body, or to return the whole `ResponseEntity` as the reply message payload, independently of the provided `expectedResponseType`.
Same option is presented for the `WebFluxRequestExecutingMessageHandler`, too.
See <<./http.adoc#http,HTTP Support>> for more information.
[[x5.5-file]]
==== File/FTP/SFTP Changes
The persistent file list filters now have a boolean property `forRecursion`.
Setting this property to `true`, also sets `alwaysAcceptDirectories`, which means that the recursive operation on the outbound gateways (`ls` and `mget`) will now always traverse the full directory tree each time.
This is to solve a problem where changes deep in the directory tree were not detected.
In addition, `forRecursion=true` causes the full path to files to be used as the metadata store keys; this solves a problem where the filter did not work properly if a file with the same name appears multiple times in different directories.
IMPORTANT: This means that existing keys in a persistent metadata store will not be found for files beneath the top level directory.
For this reason, the property is `false` by default; this may change in a future release.
The `FileInboundChannelAdapterSpec` has now a convenient `recursive(boolean)` option instead of requiring an explicit reference to the `RecursiveDirectoryScanner`.
The `remoteDirectoryExpression` can now be used in the `mv` command for convenience.
[[x5.5-mongodb]]
==== MongoDb Changes
The `MongoDbMessageSourceSpec` was added into MongoDd Java DSL.
An `update` option is now exposed on both the `MongoDbMessageSource` and `ReactiveMongoDbMessageSource` implementations.
See <<./mongodb.adoc#mongodb,MongoDb Support>> for more information.
[[x5.5-websocket]]
==== WebSockets Changes
The WebSocket channel adapters based on `ServerWebSocketContainer` can now be registered and removed at runtime.
See <<./web-sockets.adoc#web-sockets,WebSockets Support>> for more information.
[[x5.5-jpa]]
==== JPA Changes
The `JpaOutboundGateway` now supports an `Iterable` message payload for a `PersistMode.DELETE`.
See <<./jpa.adoc#jpa-outbound-channel-adapter,Outbound Channel Adapter>> for more information.
[[x55-gw]]
==== Gateway Changes
Previously, when using XML configuration, `@Gateway.payloadExpression` was ignored for no-argument methods.
There is one possible breaking change - if the method is annotated with `@Payload` as well as `@Gateway` (with a different expression) previously, the `@Payload` would be applied, now the `@Gateway.payloadExpression` is applied.
See <<./gateway.adoc#gateway-configuration-annotations,Gateway Configuration with Annotations and XML>> and <<./gateway.adoc#gateway-calling-no-argument-methods,Invoking No-Argument Methods>> for more information.

View File

@@ -156,12 +156,6 @@ The following table summarizes the various endpoints with quick links to the app
| N
| N
| *RMI*
| N
| N
| <<./rmi.adoc#rmi-inbound,Inbound RMI>>
| <<./rmi.adoc#rmi-outbound,Outbound RMI>>
| *RSocket*
| N
| N

View File

@@ -2,6 +2,8 @@
== Change History
// BE SURE TO PRECEDE ALL include:: with a blank line - see https://github.com/asciidoctor/asciidoctor/issues/1297
include::./changes-5.4-5.5.adoc[]
include::./changes-5.3-5.4.adoc[]
include::./changes-5.2-5.3.adoc[]

View File

@@ -24,7 +24,7 @@ compile "org.springframework.integration:spring-integration-http:{project-versio
----
====
The `javax.servlet:javax.servlet-api` dependency must be provided on the target Servlet container.
The `jakarta.servlet:jakarta.servlet-api` dependency must be provided on the target Servlet container.
[[http-inbound]]
=== Http Inbound Components
@@ -478,7 +478,7 @@ Since Spring Integration 3.0, in addition to the existing `#pathVariables` and `
Note that `#matrixVariables` requires Spring MVC 3.2 or higher.
* `#requestAttributes`: The `org.springframework.web.context.request.RequestAttributes` associated with the current request.
* `#requestHeaders`: The `org.springframework.http.HttpHeaders` object from the current request.
* `#cookies`: The `Map<String, Cookie>` of `javax.servlet.http.Cookie` instances from the current request.
* `#cookies`: The `MultiValueMap<String, Cookie>` of `jakarta.servlet.http.Cookie` instances from the current request.
Note that all these values (and others) can be accessed within expressions in the downstream message flow through the `ThreadLocal` `org.springframework.web.context.request.RequestAttributes` variable, if that message flow is single-threaded and lives within the request thread.
The following example configures a transformer that uses an `expression` attribute:

View File

@@ -65,8 +65,6 @@ include::./redis.adoc[]
include::./resource.adoc[]
include::./rmi.adoc[]
include::./rsocket.adoc[]
include::./sftp.adoc[]

View File

@@ -42,7 +42,6 @@ This documentation is also available as single searchable link:index-single.html
<<./r2dbc.adoc#r2dbc,R2DBC Support>> ::
<<./redis.adoc#redis,Redis Support>> ::
<<./resource.adoc#resource,Resource Support>> ::
<<./rmi.adoc#rmi,RMI Support>> ::
<<./rsocket.adoc#rsocket,RSocket Support>> ::
<<./sftp.adoc#sftp,SFTP Adapters>> ::
<<./stomp.adoc#stomp,STOMP Support>> ::

View File

@@ -15,13 +15,13 @@ This section details the compatible https://www.oracle.com/technetwork/java/java
[[supported-java-versions]]
=== Compatible Java Versions
For Spring Integration 5.5.x, the minimum compatible Java version is Java SE 8.
For Spring Integration 6.0.x, the minimum compatible Java version is Java SE 17.
Older versions of Java are not supported.
[[supported-spring-versions]]
=== Compatible Versions of the Spring Framework
Spring Integration 5.5.x requires Spring Framework 5.3 or later.
Spring Integration 6.0.x requires Spring Framework 6.0 or later.
[[code-conventions]]
== Code Conventions

View File

@@ -2,123 +2,32 @@
= What's New?
[[spring-integration-intro-new]]
For those who are already familiar with Spring Integration, this chapter provides a brief overview of the new features of version 5.5.
For those who are already familiar with Spring Integration, this chapter provides a brief overview of the new features of version 6.0.
If you are interested in the changes and features that were introduced in earlier versions, see the <<./history.adoc#history,Change History>>.
[[whats-new]]
== What's New in Spring Integration 5.5?
== What's New in Spring Integration 6.0?
If you are interested in more details, see the Issue Tracker tickets that were resolved as part of the 5.5 development process.
If you are interested in more details, see the Issue Tracker tickets that were resolved as part of the 6.0 development process.
[[x5.5-new-components]]
In general the project has been moved to Java 17 base line and migrated from Java EE to Jakarta EE.
[[x6.0-new-components]]
=== New Components
[[x5.5-file-aggregator]]
==== File Aggregator
A `FileSplitter.FileMaker`-based implementation of `CorrelationStrategy`, `ReleaseStrategy` and `MessageGroupProcessor` as a `FileAggregator` component was introduced.
See <<./file.adoc#file-aggregator, File Aggregator>> for more information.
[[x5.5-mqtt-v5]]
==== MQTT v5 Support
The `Mqttv5PahoMessageDrivenChannelAdapter` and `Mqttv5PahoMessageHandler` (including respective `MqttHeaderMapper`) were introduced to support MQTT v5 protocol communication.
See <<./mqtt.adoc#mqtt-v5, MQTT v5 Support>> for more information.
[[x5.5-general]]
[[x6.0-general]]
=== General Changes
All the persistent `MessageGroupStore` implementation provide a `streamMessagesForGroup(Object groupId)` contract based on the target database streaming API.
See <<./message-store.adoc#message-store,Message Store>> for more information.
[[x6.0-http]]
=== HTTP Changes
The `integrationGlobalProperties` bean (if declared) must be now an instance of `org.springframework.integration.context.IntegrationProperties` instead of `java.util.Properties`, which support is deprecated for backward compatibility.
The `spring.integration.channels.error.requireSubscribers=true` global property is added to indicate that the global default `errorChannel` must be configured with the `requireSubscribers` option (or not).
The `spring.integration.channels.error.ignoreFailures=true` global property is added to indicate that the global default `errorChannel` must ignore (or not) dispatching errors and pass the message to the next handler.
See <<./configuration.adoc#global-properties,Global Properties>> for more information.
An `AbstractPollingEndpoint` (source polling channel adapter and polling consumer) treats `maxMessagesPerPoll == 0` as to skip calling the source.
It can be changed to different value later on, e.g. via a Control Bus.
See <<./endpoint.adoc#endpoint-pollingconsumer,Polling Consumer>> for more information.
The `ConsumerEndpointFactoryBean` now accept a `reactiveCustomizer` `Function` to any input channel as reactive stream source and use a `ReactiveStreamsConsumer` underneath.
This is covered as a `ConsumerEndpointSpec.reactive()` option in Java DSL and as a `@Reactive` nested annotation for the messaging annotations.
See <<./reactive-streams.adoc#reactive-streams,Reactive Streams Support>> for more information.
The `groupTimeoutExpression` for a correlation message handler (an `Aggregator` and `Resequencer`) can now be evaluated to a `java.util.Date` for some fine-grained scheduling use-cases.
Also the `BiFunction groupConditionSupplier` option is added to the `AbstractCorrelatingMessageHandler` to supply a `MessageGroup` condition against a message to be added to the group.
See <<./aggregator.adoc#aggregator,Aggregator>> for more information.
The `MessageGroup` abstraction can be supplied with a `condition` to evaluate later on to make a decision for the group.
See <<./message-store.adoc#message-group-condition,Message Group Condition>> for more information.
[[x5.5-integration-flows-composition]]
==== Integration Flows Composition
The new `IntegrationFlows.from(IntegrationFlow)` factory method has been added to allow starting the current `IntegrationFlow` from the output of an existing flow.
In addition, the `IntegrationFlowDefinition` has added a `to(IntegrationFlow)` terminal operator to continue the current flow at the input channel of some other flow.
See <<./dsl.adoc#integration-flows-composition,Integration Flows Composition>> for more information.
[[x5.5-amqp]]
==== AMQP Changes
The `AmqpInboundChannelAdapter` and `AmqpInboundGateway` (and the respective Java DSL builders) now support an `org.springframework.amqp.rabbit.retry.MessageRecoverer` as an AMQP-specific alternative to the general purpose `RecoveryCallback`.
See <<./amqp.adoc#amqp,AMQP Support>> for more information.
[[x5.5-redis]]
==== Redis Changes
The `ReactiveRedisStreamMessageProducer` has now setters for all the `StreamReceiver.StreamReceiverOptionsBuilder` options, including an `onErrorResume` function.
See <<./redis.adoc#redis,Redis Support>> for more information.
[[x5.5-http]]
==== HTTP Changes
The `HttpRequestExecutingMessageHandler` doesn't fallback to the `application/x-java-serialized-object` content type any more and lets the `RestTemplate` make the final decision for the request body conversion based on the `HttpMessageConverter` provided.
It also has now an `extractResponseBody` flag (which is `true` by default) to return just the response body, or to return the whole `ResponseEntity` as the reply message payload, independently of the provided `expectedResponseType`.
Same option is presented for the `WebFluxRequestExecutingMessageHandler`, too.
The `#cookies` variable for expression evaluation context, exposed in the `HttpRequestHandlingEndpointSupport`, is now a `MultiValueMap` to carry all the values for cookies set by the client.
See <<./http.adoc#http,HTTP Support>> for more information.
[[x5.5-file]]
==== File/FTP/SFTP Changes
[[x6.0-rmi]]
=== RMI Removal
The persistent file list filters now have a boolean property `forRecursion`.
Setting this property to `true`, also sets `alwaysAcceptDirectories`, which means that the recursive operation on the outbound gateways (`ls` and `mget`) will now always traverse the full directory tree each time.
This is to solve a problem where changes deep in the directory tree were not detected.
In addition, `forRecursion=true` causes the full path to files to be used as the metadata store keys; this solves a problem where the filter did not work properly if a file with the same name appears multiple times in different directories.
IMPORTANT: This means that existing keys in a persistent metadata store will not be found for files beneath the top level directory.
For this reason, the property is `false` by default; this may change in a future release.
The `FileInboundChannelAdapterSpec` has now a convenient `recursive(boolean)` option instead of requiring an explicit reference to the `RecursiveDirectoryScanner`.
The `remoteDirectoryExpression` can now be used in the `mv` command for convenience.
[[x5.5-mongodb]]
==== MongoDb Changes
The `MongoDbMessageSourceSpec` was added into MongoDd Java DSL.
An `update` option is now exposed on both the `MongoDbMessageSource` and `ReactiveMongoDbMessageSource` implementations.
See <<./mongodb.adoc#mongodb,MongoDb Support>> for more information.
[[x5.5-websocket]]
==== WebSockets Changes
The WebSocket channel adapters based on `ServerWebSocketContainer` can now be registered and removed at runtime.
See <<./web-sockets.adoc#web-sockets,WebSockets Support>> for more information.
[[x5.5-jpa]]
==== JPA Changes
The `JpaOutboundGateway` now supports an `Iterable` message payload for a `PersistMode.DELETE`.
See <<./jpa.adoc#jpa-outbound-channel-adapter,Outbound Channel Adapter>> for more information.
[[x55-gw]]
==== Gateway Changes
Previously, when using XML configuration, `@Gateway.payloadExpression` was ignored for no-argument methods.
There is one possible breaking change - if the method is annotated with `@Payload` as well as `@Gateway` (with a different expression) previously, the `@Payload` would be applied, now the `@Gateway.payloadExpression` is applied.
See <<./gateway.adoc#gateway-configuration-annotations,Gateway Configuration with Annotations and XML>> and <<./gateway.adoc#gateway-calling-no-argument-methods,Invoking No-Argument Methods>> for more information.
The `spring-integration-rmi` module has been removed altogether after being deprecated in previous versions.
There is no replacement: it is recommended to migrate to more secure network and application protocols, such as WebSockets, RSockets, gRPC or REST.