[[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 xref:file/aggregator.adoc[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 xref: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 xref:message-store.adoc[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 xref:configuration/global-properties.adoc[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 xref: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 xref:reactive-streams.adoc[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 xref:overview.adoc#overview-endpoints-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 xref: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 xref:dsl/integration-flows-composition.adoc[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 xref:amqp.adoc[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 xref:redis.adoc[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 xref:http.adoc[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 xref:mongodb.adoc[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 xref:web-sockets.adoc[WebSockets Support] for more information.

[[x5.5-jpa]]
== JPA Changes

The `JpaOutboundGateway` now supports an `Iterable` message payload for a `PersistMode.DELETE`.

See xref:jpa/outbound-channel-adapter.adoc[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 xref:gateway.adoc#gateway-configuration-annotations[Gateway Configuration with Annotations and XML] and xref:gateway.adoc#gateway-calling-no-argument-methods[Invoking No-Argument Methods] for more information.
