如需使用最新稳定版本,请使用 Spring Integration 7.0.4spring-doc.cadn.net.cn

5.5 与 6.0 之间的变更

新组件

已为集成流定义添加了 Groovy DSL 实现。 有关更多信息,请参见 Groovy DSLspring-doc.cadn.net.cn

MQTT 客户端管理器

一个新的 MQTT ClientManager 已添加,以支持在不同通道适配器之间复用 MQTT 连接。 有关更多信息,请参阅 共享 MQTT 客户端支持spring-doc.cadn.net.cn

GraphQL 支持

已添加 GraphQL 支持。 有关更多信息,请参阅 GraphQL 支持spring-doc.cadn.net.cn

Apache Camel 支持

已引入对 Apache Camel 路由的支持。 有关更多信息,请参见 Apache Camel 支持spring-doc.cadn.net.cn

Hazelcast 支持

The Hazelcast Spring Integration Extensions 项目已迁移为 spring-integration-hazelcast 模块。 有关更多信息,请参见 Hazelcast 支持spring-doc.cadn.net.cn

SMB 支持

已从 Spring Integration Extensions 项目添加 SMB 支持。 Java DSL(参见 org.springframework.integration.smb.dsl.Smb 工厂)也已添加到该模块中。 引入了 SmbStreamingMessageSourceSmbOutboundGateway 的实现。 有关更多信息,请参阅 SMB 支持spring-doc.cadn.net.cn

PostgreSQL 推送通知

一个 PostgresSubscribableChannel 允许在有新消息添加到 JdbcChannelMessageStore 时,通过 PostgresChannelMessageTableSubscriber 接收推送通知。spring-doc.cadn.net.cn

有关更多信息,请参阅 PostgreSQL:接收推送通知spring-doc.cadn.net.cn

RabbitMQ 流队列支持

AMQP 模块已增强,以提供使用 RabbitMQ Stream 队列的入站和出站通道适配器的支持。 有关更多信息,请参阅 RabbitMQ Stream 队列支持spring-doc.cadn.net.cn

Apache MINA SFTP

SFTP 模块已从过时的 JCraft JSch 库全面重构为更健壮、更现代的 Apache MINA 项目的 org.apache.sshd:sshd-sftp 模块。spring-doc.cadn.net.cn

有关更多信息,请参阅 SFTP 适配器spring-doc.cadn.net.cn

Micrometer 观测

现在支持使用 Micrometer 启用计时器和跟踪的观察功能。 有关更多信息,请参阅 Micrometer 观察spring-doc.cadn.net.cn

GraalVM 多语言支持

脚本模块现在提供了基于 GraalVM Polyglot 支持的 PolyglotScriptExecutor 实现。 JavaScript 支持现在基于此执行器,因为其 JSR223 实现已从 Java 本身中移除。 有关更多信息,请参阅 脚本支持spring-doc.cadn.net.cn

Apache Cassandra 支持

The Apache Cassandra Spring Integration Extensions 项目已迁移为 spring-integration-cassandra 模块。 有关更多信息,请参阅 Apache Cassandra 支持spring-doc.cadn.net.cn

Kotlin 协程

框架已引入 Kotlin Coroutines 支持。spring-doc.cadn.net.cn

有关更多信息,请查看 Kotlin 协程spring-doc.cadn.net.cn

原生镜像

支持创建 GraalVM 本地镜像。 有关更多信息,请参阅 本地镜像支持spring-doc.cadn.net.cn

常规变更

消息注解现在是@Repeatable,并且相同的类型可以在同一个服务方法上声明多次。 消息注解不再需要作为@Poller数组的poller属性了。spring-doc.cadn.net.cn

有关更多信息,请参见 注解支持spring-doc.cadn.net.cn

为方便起见,基于RecipientListRouter的Scatter-Gather的XML和Java DSL现在会设置一个applySequence = true,以便收集器部分可以依赖默认的相关策略。spring-doc.cadn.net.cn

有关更多信息,请查看 散列-收集spring-doc.cadn.net.cn

AbstractMappingMessageRouter 又进行了另一项便捷的行为变更。 现在,设置 defaultOutputChannel 也会将 channelKeyFallback 属性重置为 false,因此不会再尝试从其键解析通道,但逻辑会立即回退到将消息发送到 defaultOutputChannelspring-doc.cadn.net.cn

有关更多信息,请参阅 路由选项spring-doc.cadn.net.cn

The AggregatingMessageHandler 现在不会将 MessageGroupProcessorCollection<Message<?>> 结果拆分(除非它是 SimpleMessageGroupProcessor),而是输出一个包含整个集合作为负载的单条消息。spring-doc.cadn.net.cn

有关更多信息,请参见 聚合器spring-doc.cadn.net.cn

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.spring-doc.cadn.net.cn

有关更多信息,请参见 Java DSLspring-doc.cadn.net.cn

The org.springframework.util.concurrent.ListenableFuture 自 Spring Framework 6.0 起已被弃用。 所有 Spring Integration 异步 API 已迁移至 CompletableFuturespring-doc.cadn.net.cn

Messaging Gateway 接口方法现在可以返回 Future<Void>Mono<Void>,并支持下游流程的正确异步执行。spring-doc.cadn.net.cn

@MessagingGateway 注解一起,接口也可以标记为 @Primaryspring-doc.cadn.net.cn

@MessagingGateway 接口现在可以用作配置的 @Import 资源。spring-doc.cadn.net.cn

网关代理 bean 的默认命名策略可以通过 @IntegrationComponentScan.nameGenerator() 属性进行自定义。 如果存在 AnnotationConfigUtils.CONFIGURATION_BEAN_NAME_GENERATOR bean,则优先咨询它,否则回退到使用 AnnotationBeanNameGeneratorspring-doc.cadn.net.cn

有关更多信息,请参阅消息网关spring-doc.cadn.net.cn

The integrationGlobalProperties bean 现在由框架声明为 org.springframework.integration.context.IntegrationProperties 的实例,而不是之前已弃用的 java.util.Propertiesspring-doc.cadn.net.cn

产生集合作为回复的消息处理器(例如 JpaOutboundGatewayJdbcOutboundGateway 和其他基于数据库的网关)现在如果查询未返回任何记录,将返回空结果列表。 此前,会返回 null 以结束流程,或者根据 requiresReply 抛出异常。spring-doc.cadn.net.cn

RMI 移除

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.spring-doc.cadn.net.cn

GemFire 移除

由于 Spring Data 2022.0.0 不支持 VMware GemFire 或 Apache Geode,因此 spring-integration-gemfire 模块已被完全移除。spring-doc.cadn.net.cn

HTTP 变更

用于表达式求值上下文的#cookies变量,在HttpRequestHandlingEndpointSupport中暴露,现在是一个MultiValueMap,用于承载客户端设置的所有Cookie值。 有关更多信息,请参阅HTTP支持spring-doc.cadn.net.cn

Apache Kafka 变更

当在入站网关或消息驱动通道适配器上提供 RetryTemplate 时,如果同时提供了 errorChannel,将自动配置 ErrorMessageSendingRecovererspring-doc.cadn.net.cn

此外,还提供了新的 KafkaErrorMessageSendingRecoverer;它可以与 DefaultErrorHandler 配合使用,以避免因长期聚合的重试延迟导致分区重新平衡的问题。spring-doc.cadn.net.cn

有关更多信息,请参阅 Spring for Apache Kafka 支持spring-doc.cadn.net.cn

JDBC 更改

The DefaultLockRepository can now be supplied with a PlatformTransactionManager instead of relying on the primary bean from the application context.spring-doc.cadn.net.cn

有关更多信息,请参阅 JDBC 锁注册表spring-doc.cadn.net.cn

TCP/IP 更改

The lookupHost 属性现在默认设置为 false,以避免在 DNS 未配置的环境中产生延迟。spring-doc.cadn.net.cn

有关更多信息,请参阅 TCP 和 UDP 支持spring-doc.cadn.net.cn

JMS 变更

如果将 replyPubSubDomain 选项设置为 true,则 JmsOutboundGateway 现在会创建 TemporaryTopic 而不是 TemporaryQueuespring-doc.cadn.net.cn

有关更多信息,请查看 JMS 支持spring-doc.cadn.net.cn

安全变更

The ChannelSecurityInterceptor 及其注解 @SecuredChannel 和 XML <secured-channels> 配置已被弃用,取而代之的是 AuthorizationChannelInterceptorspring-doc.cadn.net.cn

有关更多信息,请参见 安全支持spring-doc.cadn.net.cn

Webflux 请求属性支持

Webclient 请求属性支持已添加到 WebFluxRequestExecutingMessageHandlerspring-doc.cadn.net.cn

有关更多信息,请参阅 WebFlux 请求属性spring-doc.cadn.net.cn