How many times kafka stream invokes poll() for fetching records from kafka topic

本小妞迷上赌 提交于 2019-12-01 08:11:33

问题


I am trying to understand kafka stream processor a bit more. I want to know what is the frequency of polling by a kafka stream processor for fetching the data from kafka.

As I understand kafka stream processor internally creates a kafka Consumer client which fetches the data from kafka (and it invokes poll()).

So when first time poll() is called, what is the next time it would be called again to fetch data from kafka? Does it happen many times per second ? How can I know how many times poll() has been called (for fetching data from kafka).

Any help in understanding this would be of great help.


回答1:


There is no absolute number on how often poll() is called. There are multiple factors that impact how often poll() is called. As a simplified model, you can assume that poll() is called, fetches N records, and is called again after all N records are processed.

Kafka Streams collects metrics that tell you how often poll() is called though, so you can easily monitor it: https://docs.confluent.io/current/streams/monitoring.html



来源:https://stackoverflow.com/questions/56379412/how-many-times-kafka-stream-invokes-poll-for-fetching-records-from-kafka-topic

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