|
此版本仍在开发中,尚未被视为稳定版本。对于最新的稳定版本,请使用 Spring Integration 6.4.0! |
MessageChannelSpec.wireTap()
Spring 集成包括一个.wireTap()流畅的 APIMessageChannelSpec建设者。
以下示例演示如何使用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.
以下示例没有任何 channel 声明:
.handle(...)
.log()
}
在前面的示例中(以及任何时候未声明 channel),隐式的DirectChannel被注入到IntegrationFlow并用作当前配置的ServiceActivatingHandler(来自.handle(),如前所述)。