轮询的入站通道适配器
概述
版本 5.0.1 引入了轮询通道适配器,允许您按需获取单个消息 — 例如,使用MessageSourcePollingTemplate或轮询器。
有关更多信息,请参阅 Deferred Acknowledgment Pollable Message Source (延迟确认轮询消息源) 以了解更多信息。
它当前不支持 XML 配置。
以下示例说明如何配置AmqpMessageSource:
- 
Java DSL 
- 
Java 
@Bean
public IntegrationFlow flow() {
    return IntegrationFlow.from(Amqp.inboundPolledAdapter(connectionFactory(), DSL_QUEUE),
                    e -> e.poller(Pollers.fixedDelay(1_000)).autoStartup(false))
            .handle(p -> {
                ...
            })
            .get();
}@Bean
public AmqpMessageSource source(ConnectionFactory connectionFactory) {
    return new AmqpMessageSource(connectionFactory, "someQueue");
}有关配置属性,请参阅 Javadoc。
XML 格式
This adapter currently does not have XML configuration support.批量消息
请参阅 Batched Messages (批量消息)。
对于轮询的适配器,没有侦听器容器,批处理的消息始终是取消批处理的(如果BatchingStrategy支持这样做)。