日志中一直打印如下信息:
Auto offset commit failed ,Commit cannot be completed since the group has already rebalanced and assigned the partitions to another member. This means that the time between subsequent calls to poll() was longer than the configured max.poll.interval.ms, which typically implies that the poll loop is spending too much time message processing. You can address this either by increasing the session timeout or by reducing the maximum size of batches returned in poll() with max.poll.records.
我的参数是这样配置的:
bootstrap.servers=192.168.1.1:9092,192.168.1.2:9092
group.id=test
auto.commit.interval.ms=1000
key.deserializer=org.apache.kafka.common.serialization.StringDeserializer
value.deserializer=org.apache.kafka.common.serialization.StringDeserializer
max.poll.interval.ms=300
max.poll.records=100
session.timeout.ms=30000
heartbeat.interval.ms=1000
auto.offset.reset=earliest
request.timeout.ms=40000
fetch.min.bytes=1
fetch.wait.max.ms=1000
代码中
ConsumerRecords
出现以上问题是我的参数设置不合理还是怎么回事?
你处理的时间太长,导致没有调用poll(),就重新分配了,调整max.poll.interval.ms
你的答案