like :
topic_name = "auto-remediation"
address = "sape-zookeeper-1"
I need to remove hard coded values and pass the variable here :
consumer = KafkaConsumer(b'auto-remediation', bootstrap_servers='sape-zookeeper-1:9092')
like :
topic_name = "auto-remediation"
address = "sape-zookeeper-1"
I need to remove hard coded values and pass the variable here :
consumer = KafkaConsumer(b'auto-remediation', bootstrap_servers='sape-zookeeper-1:9092')
Nothing is hardcoded in kafka-python consumer. You can replace any parameter with a variable. Just make sure that the variables are initialized and have correct string in them before you create client object like:
topic_name = "auto-remediation"
address = "sape-zookeeper-1"
consumer = KafkaConsumer(topic_name, bootstrap_servers=address)