I want to check if my topic is empty after changing a retention.ms to 100ms. I try to consume from my topic like this :
consumer_kafka = KafkaConsumer(topic, bootstrap_servers=bootstrap_servers, auto_offset_reset='latest',
consumer_timeout_ms=10000)
for message in consumer_kafka:
if message is None:
return True
else:
return False
If return True (topic purged) so i send my json files. But this method return None. Can anyone help me ?.