此版本仍在开发中,尚未被视为稳定版。如需最新稳定版本,请使用 Spring Integration 7.0.4spring-doc.cadn.net.cn

什么是新内容?

对于已经熟悉 Spring Integration 的读者,本章简要概述了 6.5 版本的新特性。spring-doc.cadn.net.cn

如果您对早期版本中引入的更改和功能感兴趣,请参阅变更历史记录spring-doc.cadn.net.cn

Spring Integration 6.5 中有什么新功能?

如果您想了解更多详细信息,请参阅作为6.5开发过程一部分解决的Issue Tracker工单。spring-doc.cadn.net.cn

通常,该项目已迁移至最新的依赖版本。spring-doc.cadn.net.cn

常规变更

之前使用 org.springframework.util.concurrent.ListenableFuture 的方式已被弃用,现已改用 CompletableFuturespring-doc.cadn.net.cn

之前已弃用的基于 SpEL 的控制总线组件已被移除,取而代之的是围绕 ControlBusCommandRegistry 的功能。 <control-bus use-registry=""> 属性现已弃用且无替代方案,因为仅支持 ControlBusCommandRegistry 功能。 Java DSL controlBusOnRegistry() 操作符已被弃用,取而代之的是已恢复的 controlBus(),该功能现在完全基于 ControlBusCommandRegistry。 有关更多信息,请参阅 控制总线spring-doc.cadn.net.cn

由于MessageGroupProcessor的原因,AbstractCorrelatingMessageHandler不会为负载集合抛出IllegalArgumentException。 相反,该集合会被封装成单个回复消息。 有关更多信息,请参阅聚合器(Aggregator)spring-doc.cadn.net.cn

现在,当尝试向未运行的应用程序发送消息时,AbstractMessageChannel个bean会抛出特殊的MessageDispatchingException异常。 一般来说,从afterPropertiesSet()@PostConstruct或bean定义方法中尝试生成消息是一种设计错误。 对于此类逻辑,推荐使用SmartLifecycle.start(),或者通过入站通道适配器来实现更为恰当。spring-doc.cadn.net.cn

The Java DSL gateway() 运算符现在完全支持async(true)行为。 有关更多信息,请参阅消息网关spring-doc.cadn.net.cn

LockRequestHandlerAdvice

引入了一个新的 LockRequestHandlerAdvice,用于基于消息处理程序调用的请求消息为某个键保持锁。 有关更多信息,请参阅 向端点添加行为spring-doc.cadn.net.cn

discardIndividuallyOnExpiry相关处理程序的选项

聚合器和重新排序器现在可以通过将 discardIndividuallyOnExpiry 设置为 false,将整个过期的组作为单条消息丢弃。 有关更多信息,请参阅 ReleaseStrategyspring-doc.cadn.net.cn

LockRegistryMessageStore

The AbstractMessageGroupStore now can be configured with a LockRegistry to perform series of persistent operation atomically. See Use LockRegistry for more information.spring-doc.cadn.net.cn

Micrometer 观测变更

The SourcePollingChannelAdapter endpoint now starts a CONSUMER kind observation for the received message. The MessageReceiverContext now distinguishes between handler, message-source and message-producer values for the spring.integration.type low cardinality tag. See Micrometer Observation for more information.spring-doc.cadn.net.cn

可选的 Paho MQTT 依赖项

org.eclipse.paho:org.eclipse.paho.client.mqttv3 依赖项对于 spring-integration-mqtt 现在也是可选的,就像 org.eclipse.paho:org.eclipse.paho.mqttv5.client 一直那样。 有关更多信息,请参阅 MQTT 支持spring-doc.cadn.net.cn

Apache Kafka 支持变更

默认情况下,KafkaMessageSourceKafkaMessageDrivenChannelAdapter 现在生成 MessageHeaders.IDMessageHeaders.TIMESTAMP 标题,因为其余的 Spring Integration 通道适配器也是如此。 通过注入具有默认设置的 MessagingMessageConverter,可以恢复为之前的行为。 有关更多信息,请参阅 Apache Kafka 支持spring-doc.cadn.net.cn

最近文件过滤器支持

已引入 AbstractRecentFileListFilter 策略,仅接受根据提供的 age 判断不够陈旧的文件。 相应的实现包括:RecentFileListFilterFtpRecentFileListFilterSftpRecentFileListFilterSmbRecentFileListFilter。 有关更多信息,请参阅 读取文件spring-doc.cadn.net.cn

FileExistsMode 表达式支持

远程文件网关 (AbstractRemoteFileOutboundGateway) 现在支持通过 SpEL 表达式在运行时动态解析 FileExistsMode。 有关更多信息,请参阅 远程文件网关spring-doc.cadn.net.cn

Hazelcast 模块弃用

The HazelcastLockRegistry and Hazelcast LeaderInitiator 已弃用,原因是 Hazelcast CP 子系统已迁移至企业版。 有关更多信息,请参阅 Hazelcast 支持spring-doc.cadn.net.cn

JDBC 支持

The BeanPropertySqlParameterSourceFactory现在在输入为Map时内部使用MapSqlParameterSource。 此外,JdbcMessageHandler暴露了一个usePayloadAsParameterSource标志,允许仅针对消息负载处理参数源。 这正是提到的MapSqlParameterSource对于具有map类型负载的请求消息变得有用的地方。 有关更多信息,请参阅JDBC支持spring-doc.cadn.net.cn

Redis Stream 支持

The ReactiveRedisStreamMessageHandler now exposes a Function<Message<?>, RedisStreamCommands.XAddOptions> to provide additional XADD option via convenient RedisStreamCommands.XAddOptions API. See Redis 支持 for more information.spring-doc.cadn.net.cn