Kafka - Basics and Event Streaming
You want to send a message to a Kafka topic and then immediately consume that same message in Python using kafka-python. Which approach ensures you consume the first message you just produced?
producer.flush() guarantees the message is actually sent to Kafka before consuming.auto_offset_reset='earliest' ensures the consumer reads from the beginning if no committed offset exists.auto_offset_reset='latest' and read messages. uses 'latest' offset, which may skip the message.15+ quiz questions · All difficulty levels · Free
Free Signup - Practice All Questions