IdleBetween pools not pulling Messages as specified

故事扮演 提交于 2019-12-11 18:33:12

问题


I am consuming messages in batch mode. I wanted to pull 8 messages each 250 ms from stream.

spring:  
  cloud:
    stream:
      kinesis:
        bindings:
          input:
            consumer:
              listenerMode: batch
              idleBetweenPolls: 250
              recordsLimit: 8
      bindings:
        input:
          group: my-group
          destination: stream
          content-type: application/json

I have pushed around 100 messages on to stream, and I started the consumer.

As per configuration, I am supposed to pull messages each 250 ms. But the poller not pulling messages each 250 ms.

@StreamListener(Sink.INPUT)
  public void receiveMessage(Message<List<byte[]>> messages) {
    log.info("Total received messages: " + messages.getPayload().size());
  }

2019-04-27 12:04:40.145 : Total received messages: 8
2019-04-27 12:04:41.604 : Total received messages: 8
2019-04-27 12:04:43.167 : Total received messages: 8
2019-04-27 12:04:44.618 : Total received messages: 8
2019-04-27 12:04:46.145 : Total received messages: 8
2019-04-27 12:04:47.775 : Total received messages: 8
2019-04-27 12:04:49.211 : Total received messages: 8
2019-04-27 12:04:50.756 : Total received messages: 8
2019-04-27 12:04:52.283 : Total received messages: 8
2019-04-27 12:04:53.817 : Total received messages: 8

I am not even processing anything at all. Its just log.

The time between each messages are more than 250 ms. Am I missing anything.


回答1:


250 ms is not meaningful for realistic use case. Maybe you could increase interval to 5 second and give a try.



来源:https://stackoverflow.com/questions/55877979/idlebetween-pools-not-pulling-messages-as-specified

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!