6.4 与 6.5 版本之间的变更

常规变更

之前使用 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

The AbstractMessageChannel beans now throw a special MessageDispatchingException when an attempt is made to send a message to an application that is not running.spring-doc.cadn.net.cn

通常,尝试从 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