from kafka import KafkaProducer, KafkaConsumer import kafka import socket consumer = KafkaConsumer(bootstrap_servers = ['localhost:9092']) print(consumer.topics())