Spring Integration 包括一个流畅的 API 构建器。
下面的示例演示如何使用该方法记录输入:.wireTap()
MessageChannelSpec
wireTap
@Bean
public QueueChannelSpec myChannel() {
return MessageChannels.queue()
.wireTap("loggingFlow.input");
}
@Bean
public IntegrationFlow loggingFlow() {
return f -> f.log();
}
如果 是 的实例,则 或运算符应用于当前 。
否则,中间体将注入到当前配置的终结点的流中。
在下面的例子中,拦截器被直接添加到,因为实现:
|
如果 是 的实例,则 或运算符应用于当前 。
否则,中间体将注入到当前配置的终结点的流中。
在下面的例子中,拦截器被直接添加到,因为实现:
|
当电流不实现时,一个隐式 和 被注入到 ,并将 添加到这个新的 .
以下示例没有任何通道声明:MessageChannel
InterceptableChannel
DirectChannel
BridgeHandler
IntegrationFlow
WireTap
DirectChannel
.handle(...)
.log()
}
在前面的示例中(以及任何时候没有声明通道),隐式被注入到当前位置,并用作当前配置的输出通道(从前面描述的 )。DirectChannel
IntegrationFlow
ServiceActivatingHandler
.handle()