kafka-python consumer start reading from offset (automatically)

后端 未结 2 1984
被撕碎了的回忆
被撕碎了的回忆 2021-02-06 12:14

I\'m trying to build an application with kafka-python where a consumer reads data from a range of topics. It is extremely important that the consumer never reads the same messag

2条回答
  •  半阙折子戏
    2021-02-06 12:38

    Is that possible to using consumer from different server. I already tried the same below is the code and its not fetching any data from kafka.

    consumer = KafkaConsumer('tet', bootstrap_servers=['192.168.1.20:9092'],
                         auto_offset_reset='earliest', enable_auto_commit=True,
                         auto_commit_interval_ms=1000, group_id=None)
    

    Note:- When I am giving wrong ip or port number its throws exceptions.

提交回复
热议问题