【问题标题】:InboundChannelAdapter issue with having fixedDelay and maxMessagesPerPoll - fixedDelay ignored具有 fixedDelay 和 maxMessagesPerPoll 的 InboundChannelAdapter 问题 - fixedDelay 被忽略
【发布时间】:2021-12-17 22:36:48
【问题描述】:

我使用 InboundChannelAdapter 每 100000 毫秒从数据库中获取数据。

 @InboundChannelAdapter(value = "inboundChannel", poller = @Poller(fixedDelay="100000",maxMessagesPerPoll = "10000"))

在我将获取的数据转换为 json 的转换器之后。

 @Transformer(inputChannel = "inboundChannel" , outputChannel = "outChannel")
 public Message<String> transformer(Message<List<MyOb>> items) 

当我运行代码时,如果 maxMessagesPerPoll 已定义,看起来 fixedDelay 将被完全忽略(不等待 100000 英里)!

如果我删除 maxMessagesPerPoll 它会起作用。

在表中我只有 2 行。

【问题讨论】:

    标签: spring-boot spring-integration


    【解决方案1】:

    看起来对maxMessagesPerPoll 有一些误解。它确实对单个轮询周期有意义。默认情况下它实际上是1,因此,这就是您看到在两个不同周期中轮询的两条消息的延迟的方式。由于您对该属性的 h m 远多于 2,因此您没有看到延迟也就不足为奇了。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2019-02-17
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2015-12-19
      • 1970-01-01
      相关资源
      最近更新 更多