Is there any method to verify how many records returned from poll in KStream(Kafka streams) before processing forEach method

Viewed 18

I want to know how many records returned from poll in KStream(Kafka streams) before processing forEach method in Kafka Consumer.

Have to create metrics based on how many records returned from poll and can verify how many processed in forEach method.

Can you please have any suggestions for this

1 Answers

If you want to count number of records fetched in a poll, you need to use Consumer API, and .count() on the ConsumerRecord iterator

Related