Changes between 5.2 and 5.3
New Components
Integration Pattern
IntegrationPattern
抽象已被引入,以指示 Spring Integration 组件所属的企业集成模式(IntegrationPatternType
)和类别。有关此抽象及其用例的更多信息,请参阅其 Java 文档和 Integration Graph。
The IntegrationPattern
abstraction has been introduced to indicate which enterprise integration pattern (an IntegrationPatternType
) and category a Spring Integration component belongs to.
See its JavaDocs and Integration Graph for more information about this abstraction and its use-cases.
ReactiveMessageHandler
ReactiveMessageHandler
现在在该框架中得到本机支持。有关更多信息,请参见 ReactiveMessageHandler。
The ReactiveMessageHandler
is now natively supported in the framework.
See ReactiveMessageHandler for more information.
ReactiveMessageSourceProducer
ReactiveMessageSourceProducer
是 MessageProducerSupport
的反应式实现,可将提供的 MessageSource
包装到 Flux
中,以按需进行 receive()
调用。有关详细信息,请参阅 Reactive Streams Support。
The ReactiveMessageSourceProducer
is a reactive implementation of the MessageProducerSupport
to wrap a provided MessageSource
into a Flux
for on demand receive()
calls.
See Reactive Streams Support for more information.
Java DSL Extensions
已引入一个新的 IntegrationFlowExtension
API,用于允许使用自定义或组合 EIP 操作符扩展现有 Java DSL。这也是为任何开箱即用的 IntegrationComponentSpec
扩展引入自定义器的机会。有关更多信息,请参见 DSL Extensions。
A new IntegrationFlowExtension
API has been introduced to allow extension of the existing Java DSL with custom or composed EIP-operators.
This also can be used to introduce customizers for any out-of-the-box IntegrationComponentSpec
extensions.
See DSL Extensions for more information.
Kotlin DSL
已引入用于集成流配置的 Kotlin DSL。有关详细信息,请参阅 Kotlin DSL Chapter。
The Kotlin DSL for integration flow configurations has been introduced. See Kotlin DSL Chapter for more information.
ReactiveRequestHandlerAdvice
提供了一个 ReactiveRequestHandlerAdvice
来定制消息处理程序的 Mono
回复。有关详细信息,请参阅 Reactive Advice。
A ReactiveRequestHandlerAdvice
is provided to customize Mono
replies from message handlers.
See Reactive Advice for more information.
HandleMessageAdviceAdapter
提供了一个 HandleMessageAdviceAdapter
来包装任何 MethodInterceptor
,以在 MessageHandler.handleMessage()
上应用,而不是默认 AbstractReplyProducingMessageHandler.RequestHandler.handleRequestMessage()
行为。有关详细信息,请参阅 Handling Message Advice。
A HandleMessageAdviceAdapter
is provided to wrap any MethodInterceptor
for applying on the MessageHandler.handleMessage()
instead of a default AbstractReplyProducingMessageHandler.RequestHandler.handleRequestMessage()
behavior.
See Handling Message Advice for more information.
MongoDB Reactive Channel Adapters
spring-integration-mongodb
模块现在提供了适用于 Spring Data 中的 Reactive MongoDb 驱动程序支持的通道适配器实现。此外,MongoDbChangeStreamMessageProducer
中还提供了对 MongoDb 变更流支持的反应式实现。有关详细信息,请参阅 MongoDB Support。
The spring-integration-mongodb
module now provides channel adapter implementations for the Reactive MongoDb driver support in Spring Data.
Also, a reactive implementation for MongoDb change stream support is present with the MongoDbChangeStreamMessageProducer
.
See MongoDB Support for more information.
ReceiveMessageAdvice
已引入一个特殊的 ReceiveMessageAdvice
来具体代理 MessageSource.receive()
或 PollableChannel.receive()
。有关更多信息,请参见 Smart Polling。
A special ReceiveMessageAdvice
has been introduced to proxy exactly MessageSource.receive()
or PollableChannel.receive()
.
See Smart Polling for more information.
General Changes
此网关代理现在默认不会代理 default
方法。有关详细信息,请参阅 xref:gateway.adoc#gateway-calling-default-methods[Invoking default
方法。
The gateway proxy now doesn’t proxy default
methods by default.
See Invoking default
Methods for more information.
内部组件(例如 _org.springframework.integration.errorLogger
)现在在其在集成图中表示时将拥有一个缩写名称。有关更多信息,请参见 Integration Graph。
Internal components (such as _org.springframework.integration.errorLogger
) now have a shortened name when they are represented in the integration graph.
See Integration Graph for more information.
在聚合器中,当 MessageGroupProcessor
返回一个 Message
时,如果 sequenceDetails
与组中第一条消息的标头匹配,则在输出消息上执行 MessageBuilder.popSequenceDetails()
。有关更多信息,请参见 Aggregator Programming Model。
In the aggregator, when the MessageGroupProcessor
returns a Message
, the MessageBuilder.popSequenceDetails()
is performed on the output message if the sequenceDetails
matches the header in the first message of the group.
See Aggregator Programming Model for more information.
一个基于 BroadcastCapableChannel`和 `BroadcastPublishSubscribeSpec`的新 `publishSubscribeChannel()`运算符已添加到 Java DSL。在将子流配置为像 `SubscribableJmsChannel
、`SubscribableRedisChannel`等经纪人支持的通道的发布订阅者时,此流畅 API 具有优势。请参阅 Sub-flows support以了解更多信息。
A new publishSubscribeChannel()
operator, based on the BroadcastCapableChannel
and BroadcastPublishSubscribeSpec
, was added into Java DSL.
This fluent API has its advantage when we configure sub-flows as pub-sub subscribers for broker-backed channels like SubscribableJmsChannel
, SubscribableRedisChannel
etc.
See Sub-flows support for more information.
Spring Integration 中的事务支持现在还包括如果 MessageSource
或 MessageHandler
实现为要发送有效负载的反应式类型,则配置 ReactiveTransactionManager
的选项。有关更多信息,请参见 TransactionInterceptorBuilder
。另外,请参见 Reactive Transactions。
Transactional support in Spring Integration now also includes options to configure a ReactiveTransactionManager
if a MessageSource
or MessageHandler
implementation produces a reactive type for payload to send.
See TransactionInterceptorBuilder
for more information.
See also Reactive Transactions.
已将用于注册 ChannelInterceptor
实例的新 intercept()
运算符添加到 Java DSL 中,而无需创建显式通道。有关详细信息,请参阅 Operator intercept()。
A new intercept()
operator to register ChannelInterceptor
instances without creating explicit channels was added into Java DSL.
See Operator intercept() for more information.
MessageStoreSelector
有一种比较旧值和新值的新机制。有关详细信息,请参阅 Idempotent Receiver Enterprise Integration Pattern。
The MessageStoreSelector
has a new mechanism to compare an old and new value.
See Idempotent Receiver Enterprise Integration Pattern for more information.
MessageProducerSupport
基类现在有一个 subscribeToPublisher(Publisher<? extends Message<?>>)
API,允许实现通过反应式 Publisher
发出消息的消息驱动生产者端点。有关详细信息,请参阅 Reactive Streams Support。
The MessageProducerSupport
base class now has a subscribeToPublisher(Publisher<? extends Message<?>>)
API to allow implementation of message-driven producer endpoints which emit messages via reactive Publisher
.
See Reactive Streams Support for more information.
AMQP Changes
出站通道适配器有一个新属性 multiSend
,允许在一个 RabbitTemplate
调用范围内发送多条消息。有关详细信息,请参阅 AMQP Outbound Channel Adapter。
The outbound channel adapter has a new property multiSend
allowing multiple messages to be sent within the scope of one RabbitTemplate
invocation.
See AMQP Outbound Channel Adapter for more information.
入站通道适配器现在支持将 consumerBatchEnabled
属性设置为 true
的侦听器容器。有关详细信息,请参阅 AMQP Inbound Channel Adapter。
The inbound channel adapter now supports a listener container with the consumerBatchEnabled
property set to true
.
See AMQP Inbound Channel Adapter
HTTP Changes
AbstractHttpRequestExecutingMessageHandler
上的 encodeUri
属性已被弃用,取而代之的是新引入的 encodingMode
。有关更多信息,请参见 DefaultUriBuilderFactory.EncodingMode
JavaDocs 和 Controlling URI Encoding。这也影响 WebFluxRequestExecutingMessageHandler
、各自的 Java DSL 和 XML 配置。相同的选项添加到 AbstractWebServiceOutboundGateway
中。
The encodeUri
property on the AbstractHttpRequestExecutingMessageHandler
has been deprecated in favor of newly introduced encodingMode
.
See DefaultUriBuilderFactory.EncodingMode
JavaDocs and Controlling URI Encoding for more information.
This also affects WebFluxRequestExecutingMessageHandler
, respective Java DSL and XML configuration.
The same option is added into an AbstractWebServiceOutboundGateway
.
Web Services Changes
已为 Web 服务组件添加了 Java DSL 支持。AbstractWebServiceOutboundGateway
上的 encodeUri
属性已被弃用,取而代之的是新引入的 encodingMode
- 类似于上述 HTTP 更改。有关详细信息,请参阅 Web Services Support。
Java DSL support has been added for Web Service components.
The encodeUri
property on the AbstractWebServiceOutboundGateway
has been deprecated in favor of newly introduced encodingMode
- similar to HTTP changes above.
See Web Services Support for more information.
TCP Changes
默认情况下,FailoverClientConnectionFactory
不再进行故障回退,直到当前连接出现故障。有关更多信息,请参见 TCP Failover Client Connection Factory。
The FailoverClientConnectionFactory
no longer fails back, by default, until the current connection fails.
See TCP Failover Client Connection Factory for more information.
TcpOutboundGateway
现支持异步请求/回复。有关更多信息,请访问 TCP Gateways。
The TcpOutboundGateway
now supports asynchronous request/reply.
See TCP Gateways for more information.
现在,你可以将某个任意测试配置到用于执行新连接的客户端连接中。有关更多信息,请访问 Testing Connections。
You can now configure client connections to perform some arbitrary test on new connections. See Testing Connections for more information.
RSocket Changes
已将 decodeFluxAsUnit
选项添加到 RSocketInboundGateway
中,其含义是解码传入的 Flux
为一个单元,或对其中的每个事件应用解码。有关更多信息,请参见 RSocket Inbound Gateway。
A decodeFluxAsUnit
option has been added to the RSocketInboundGateway
with the meaning to decode incoming Flux
as a single unit or apply decoding for each event in it.
See RSocket Inbound Gateway for more information.
Zookeeper Changes
LeaderInitiatorFactoryBean
(以及其 XML <int-zk:leader-listener>
)公开了一个 candidate
选项,以便对 Candidate
配置进行更多控制。有关更多信息,请参见 Leadership event handling。
A LeaderInitiatorFactoryBean
(as well as its XML <int-zk:leader-listener>
) exposes a candidate
option for more control over a Candidate
configuration.
See Leadership event handling for more information.
MQTT Changes
现在可以配置入站通道适配器以提供用户控制权,以便在消息被确认已交付时进行控制。有关更多信息,请参见 Manual Acks。
The inbound channel adapter can now be configured to provide user control over when a message is acknowledged as being delivered. See Manual Acks for more information.
现在,在无法创建连接或连接丢失时,出站适配器将发布 MqttConnectionFailedEvent
。以前,只有入站适配器这样做。请参阅 MQTT Events。
The outbound adapter now publishes a MqttConnectionFailedEvent
when a connection can’t be created, or is lost.
Previously, only the inbound adapter did so.
See MQTT Events.
(S)FTP Changes
除了 File
、byte[]
、String
和 InputStream
,FileTransferringMessageHandler
(例如对于 FTP 和 SFTP)现在还支持一个 org.springframework.core.io.Resource
。有关更多信息,请参阅 SFTP Support 和 FTP Support。
The FileTransferringMessageHandler
(for FTP and SFTP, for example) in addition to File
, byte[]
, String
and InputStream
now also supports an org.springframework.core.io.Resource
.
See SFTP Support and FTP Support for more information.
File Changes
对于 markersJson
模式,FileSplitter
不再需要 Jackson 处理器(或类似项)依赖项。它使用 SimpleJsonSerializer
来对 FileSplitter.FileMarker
实例进行直接字符串表示。有关更多信息,请访问 FileSplitter。
The FileSplitter
doesn’t require a Jackson processor (or similar) dependency any more for the markersJson
mode.
It uses a SimpleJsonSerializer
for a straightforward string representation of the FileSplitter.FileMarker
instances.
See FileSplitter for more information.