一个属于new consumer的配置项,出现在0.10版本中。
https://kafka.apache.org/0100/documentation.html
max.poll.records | The maximum number of records returned in a single call to poll(). | int | 2147483647 | [1,...] |
在kafka-0.9中用new consumer的kakfa streaming有一个大坑,因为consumer表明自己是否存活的heartbeat只能在poll中被触发,导致:
1. 如果配置的max.partition.fetch.bytes较大(这个值在0.9里面就不能配置过小,否则如果遇到某一条message大小超过该值,你就stcuk住了),导致单次poll的event较多,处理时间过长,超过了session.timeout.ms,会导致consumer失连,被rebalance掉。详细见:https://cwiki.apache.org/confluence/display/KAFKA/KIP-41%3A+KafkaConsumer+Max+Records</