consumer consuming the same message twice at the starting only

让人想犯罪 __ 提交于 2019-12-13 03:18:12

问题


At the very first consuming, my consumer is consuming the same message twice, this only happens at the first consuming, after that it only consumes once.


Attaching the consumer conf code below. please check for the corrections

def __init__(self, group_id, topic='default', bootstrap_servers= 
['localhost:9092']):
        self.topic = topic
        self.bootstrap_servers = bootstrap_servers
        self.group_id = group_id
        self.consumer = KafkaConsumer(## Heading ##
            self.topic,
            bootstrap_servers=self.bootstrap_servers,
            auto_offset_reset='earliest',
            enable_auto_commit=True,
            group_id=self.group_id,
            value_deserializer=lambda x: loads(x.decode('utf-8')))

来源:https://stackoverflow.com/questions/56287899/consumer-consuming-the-same-message-twice-at-the-starting-only

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!