Last active
January 23, 2023 08:03
-
-
Save merlin-quix/2d3d9e5d773dfe053fd90bcf99ee1901 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from kafka import KafkaConsumer | |
import json | |
from datetime import datetime | |
# Consume all the messages from the topic but do not mark them as 'read' (enable_auto_commit=False) | |
# so that we can re-read them as often as we like. | |
consumer = KafkaConsumer('nginx-log-producer-compressionv2', | |
group_id='test-consumer-group', | |
bootstrap_servers=['localhost:9092'], | |
value_deserializer=lambda v: json.loads(v.decode('utf-8')), | |
key_deserializer=lambda k: k.decode('utf-8'), | |
auto_offset_reset='earliest', | |
enable_auto_commit=False) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment