[[migration-5.5-6.0]]
= Changes between 5.5 and 6.0

[[x6.0-new-components]]
== New Components

A Groovy DSL implementation for integration flow definitions has been added.
See xref:groovy-dsl.adoc[Groovy DSL]  for more information.

[[x6.0-mqtt]]
=== MQTT ClientManager

A new MQTT `ClientManager` has been added to support a reusable MQTT connection across different channel adapters.
See xref:mqtt.adoc#mqtt-shared-client[Shared MQTT Client Support] for more information.

[[x6.0-graphql]]
=== GraphQL Support

The GraphQL support has been added.
See xref:graphql.adoc[GraphQL Support] for more information.

[[x6.0-camel]]
=== Apache Camel Support

Support for Apache Camel routes has been introduced.
See xref:camel.adoc[Apache Camel Support] for more information.

[[x6.0-hazelcast]]
=== Hazelcast Support

The Hazelcast Spring Integration Extensions project has been migrated as the `spring-integration-hazelcast` module.
See xref:hazelcast.adoc[Hazelcast Support]  for more information.

[[x6.0-smb]]
=== SMB Support

SMB support has been added from the Spring Integration Extensions project.
The Java DSL (see `org.springframework.integration.smb.dsl.Smb` factory) also has been added to this module.
An `SmbStreamingMessageSource` and `SmbOutboundGateway` implementation are introduced.
See xref:smb.adoc[SMB Support] for more information.

[[x6.0-postgres]]
=== PostgreSQL Push Notification

A `PostgresSubscribableChannel` allows to receive push notifications via `PostgresChannelMessageTableSubscriber` upon new messages add to the `JdbcChannelMessageStore`.

See xref:jdbc/message-store.adoc#postgresql-push[PostgreSQL: Receiving Push Notifications] for more information.

[[x6.0-rmq]]
=== RabbitMQ Stream Queue Support

The AMQP module has been enhanced to provide support for inbound and outbound channel adapters using RabbitMQ Stream Queues.
See xref:amqp/rmq-streams.adoc[RabbitMQ Stream Queue Support] for more information.

[[x6.0-sftp]]
=== Apache MINA SFTP

The SFTP modules has been fully reworked from outdated JCraft JSch library to more robust and modern `org.apache.sshd:sshd-sftp` module of the Apache MINA project.

See xref:sftp.adoc[SFTP Adapters] for more information.

[[x6.0-micrometer-observation]]
=== Micrometer Observation

Enabling observation for timers and tracing using Micrometer is now supported.
See xref:metrics.adoc#micrometer-observation[Micrometer Observation] for more information.

[[x6.0-graalmv-polyglot]]
=== GraalVM Polyglot Support

The Scripting module now provides a `PolyglotScriptExecutor` implementation based on the GraalVM Polyglot support.
JavaScript support is now based on this executor since its JSR223 implementation has been removed from Java by itself.
See xref:scripting.adoc[Scripting Support] for more information.

[[x6.0-cassandra]]
=== Apache Cassandra Support

The Apache Cassandra Spring Integration Extensions project has been migrated as the `spring-integration-cassandra` module.
See xref:cassandra.adoc[Apache Cassandra Support] for more information.

[[x6.0-kotlin-coroutines]]
=== Kotlin Coroutines

Kotlin Coroutines support has been introduced to the framework.

See xref:kotlin-functions.adoc#kotlin-coroutines[Kotlin Coroutines] for more information.

[[x6.0-aot]]
=== Native Images

Support for creating GraalVM native images is provided.
See xref:native-aot.adoc[Native Images Support] for more information.

[[x6.0-general]]
== General Changes

The messaging annotations are now `@Repeatable` and the same type can be declared several times on the same service method.
The messaging annotations don't require a `poller` attribute as an array of `@Poller` anymore.

See xref:configuration/annotations.adoc[Annotation Support] for more information.

For convenience, the XML and Java DSL for Scatter-Gather, based on the `RecipientListRouter`, now sets an `applySequence = true`, so the gatherer part can rely on the default correlation strategies.

See xref:scatter-gather.adoc[Scatter-Gather] for more information.

Another convenient behavior change has been made to the `AbstractMappingMessageRouter`.
Now, setting a `defaultOutputChannel` also resets the `channelKeyFallback` property to `false`, so no attempts will be made to resolve a channel from its key, but the logic immediately falls back to sending the message to the `defaultOutputChannel`.

See xref:router/common-parameters.adoc#router-common-parameters-all[Router Options] for more information.

The `AggregatingMessageHandler` now does not split a `Collection<Message<?>>` result of the `MessageGroupProcessor` (unless it is a `SimpleMessageGroupProcessor`) on the output, but emits a single message containing this whole collection as a payload.

See xref:overview.adoc#overview-endpoints-aggregator[Aggregator] for more information.

The `IntegrationFlows` factory is now marked as deprecated in favor of the fluent API available in the `IntegrationFlow` interface itself.
The factory class will be removed in the future releases.

See xref:dsl.adoc#java-dsl[Java DSL] for more information.

The `org.springframework.util.concurrent.ListenableFuture` has been deprecated starting with Spring Framework `6.0`.
All Spring Integration async API has been migrated to the `CompletableFuture`.

The Messaging Gateway interface method can now return `Future<Void>` and `Mono<Void>` with a proper asynchronous execution of the downstream flow.

Alongside with a `@MessagingGateway` annotation the interface can also be marked with a `@Primary`.

`@MessagingGateway` interfaces can now be use as an `@Import` resources for configuration.

The default naming strategy for gateway proxy beans can be customized via `@IntegrationComponentScan.nameGenerator()` attribute.
If `AnnotationConfigUtils.CONFIGURATION_BEAN_NAME_GENERATOR` bean is present, it is consulted otherwise before falling back to the `AnnotationBeanNameGenerator`.

See xref:gateway.adoc[Messaging Gateway] for more information.

The `integrationGlobalProperties` bean is now declared by the framework as an instance of `org.springframework.integration.context.IntegrationProperties` instead of the previously deprecated `java.util.Properties`.

Message handlers which produce a collection as a reply (e.g. `JpaOutboundGateway`, `JdbcOutboundGateway` and other DB-based gateways) now return an empty result list if no records are returned by the query.
Previously, `null` was returned ending the flow, or throwing an exception, depending on `requiresReply`.

[[x6.0-rmi]]
== RMI Removal

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.

[[x6.0-gemfire]]
== GemFire Removal

The `spring-integration-gemfire` module has been removed altogether since there is no Spring Data `2022.0.0` support for VMware GemFire or Apache Geode.

[[x6.0-http]]
== HTTP Changes

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 xref:http.adoc[HTTP Support] for more information.

[[x6.0-kafka]]
== Apache Kafka Changes

When providing a `RetryTemplate` on the inbound gateway or message-driven channel adapter, if an `errorChannel` is also provided, an `ErrorMessageSendingRecoverer` is automatically configured.

In addition, the new `KafkaErrorMessageSendingRecoverer` is provided; this can be used with a `DefaultErrorHandler` to avoid issues with long aggregated retry delays causing partitions rebalances.

See xref:kafka.adoc[Spring for Apache Kafka Support] for more information.

[[x6.0-jdbc]]
== JDBC Changes

The `DefaultLockRepository` can now be supplied with a `PlatformTransactionManager` instead of relying on the primary bean from the application context.

See xref:jdbc.adoc#jdbc-lock-registry[JDBC Lock Registry] for more information.

[[x6.0-tcp]]
== TCP/IP Changes

The `lookupHost` property of the `AbstractConnectionFactory` and `DatagramPacketMessageMapper` is now set to `false` by default to avoid delays in the environments where DNS is not configured.

See xref:ip.adoc[TCP and UDP Support] for more information.

[[x6.0-jms]]
== JMS Changes

The `JmsOutboundGateway` now creates a `TemporaryTopic` instead of `TemporaryQueue` if `replyPubSubDomain` option is set to `true`.

See xref:jms.adoc[JMS Support] for more information.

[[x6.0-security]]
== Security Changes

The `ChannelSecurityInterceptor` and its annotation `@SecuredChannel` and XML `<secured-channels>` configurations have been deprecated in favor of `AuthorizationChannelInterceptor`.

See xref:security.adoc[Security Support] for more information.

[[x6.0-webflux]]
== Webflux Request Attributes Support

Webclient Request attributes support has been added for `WebFluxRequestExecutingMessageHandler`.

See xref:webflux.adoc#webflux-request-attributes[WebFlux Request Attributes] for more information.
