Kafka consumer的参数

earliest:

当各分区下有已提交的offset时,从提交的offset开始消费;无提交的offset时,从头开始消费

latest :
当各分区下有已提交的offset时,从提交的offset开始消费;无提交的offset时,消费新产生的该分区下的数据 

enable_auto_commit (bool):

如果为True,将自动定时提交消费者offset。默认为True。

auto_commit_interval_ms (int):

自动提交offset之间的间隔毫秒数。如果enable_auto_commit 为true,默认值为: 5000。

group_id :

消费组名称。如果为None,则通过group coordinator auto-partition分区分配,offset提交被禁用。默认为None

参考:https://blog.csdn.net/luanpeng825485697/article/details/81036028

猜你喜欢

转载自www.cnblogs.com/chenyishi/p/10782628.html
今日推荐