Last active
May 12, 2023 16:56
-
-
Save antunesleo/e91b7f5a88a373202bbc2118f7b923ef 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
import json | |
from kafka import KafkaConsumer | |
from outboxexample import settings | |
print("starting consumer", settings.KAFKA_HOST) | |
NOTES_TOPIC = "notes" | |
consumer = KafkaConsumer( | |
NOTES_TOPIC, | |
bootstrap_servers=[settings.KAFKA_HOST], | |
value_deserializer=lambda m: json.loads(m.decode("utf-8")), | |
) | |
for message in consumer: | |
print(message.value) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment