I am new to the kafka world and trying to do the following for a kafka consumer in python
Note: I am ok to use either confluent-kafka / kafka-python library to achieve this.
Any help would be appreciated.
if you created your Consumer with kafka-python
from kafka import KafkaConsumer
consumer = KafkaConsumer(
bootstrap_servers = 'hostname:port',
)
you can review the list of topics available with
consumer.topics()
when you subscribe to topics, you can review the consumer subscriptions with
consumer.subscription()
You can do one minus the other to find the topics you still need to subscribe to and then you can do so with
consumer.subscribe(topics=[list_of_topic_names])