轮询入站通道适配器

概述

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

批处理消息

请参阅批处理消息

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

© . This site is unofficial and not affiliated with VMware.