跳到主要内容

轮询 inbound 通道适配器

QWen Plus 中英对照 Polled Inbound Channel Adapter

概述

版本 5.0.1 引入了一个轮询通道适配器,允许您按需获取单个消息——例如,使用 MessageSourcePollingTemplate 或轮询器。有关更多信息,请参阅延迟确认可轮询消息源

它目前不支持 XML 配置。

以下示例展示了如何配置 AmqpMessageSource

@Bean
public IntegrationFlow flow() {
return IntegrationFlow.from(Amqp.inboundPolledAdapter(connectionFactory(), DSL_QUEUE),
e -> e.poller(Pollers.fixedDelay(1_000)).autoStartup(false))
.handle(p -> {
...
})
.get();
}
java

请参阅 Javadoc 以获取配置属性。

This adapter currently does not have XML configuration support.
xml

批量消息

对于轮询适配器,没有监听器容器,批量消息总是会被解批量(如果 BatchingStrategy 支持这样做)。