| 对于最新的稳定版本,请使用 Spring Integration 6.5.1! | 
轮询的入站通道适配器
概述
版本 5.0.1 引入了一个轮询通道适配器,允许您按需获取单个消息——例如,使用MessageSourcePollingTemplate或民意调查员。
有关详细信息,请参阅延迟确认可轮询消息源。
它目前不支持 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.批处理消息
请参阅批处理消息。
对于轮询的适配器,没有侦听器容器,批处理的消息始终被解批(如果BatchingStrategy支持这样做)。