测试环境发现报错
kafka Exception in thread "xx" java.lang.OutOfMemoryError: GC overhead limit exceeded
后来经过排查,发现是消费者没有配置max.poll.records
,默认情况下该配置项的值为500,由于测试环境配置较低,并且还是多线程拉取消息,引起了堆内存不足。
该配置的说明可参考官方文档
max.poll.records
The maximum number of records returned in a single call to poll(). Note, that max.poll.records does not impact the underlying fetching behavior. The consumer will cache the records from each fetch request and returns them incrementally from each poll.
Type: int
Default: 500
Valid Values: [1,...]
Importance: medium