Skip to content

Instantly share code, notes, and snippets.

@jonathanhle
Last active October 3, 2020 00:08
Show Gist options
  • Save jonathanhle/b1f9bd8e5711be550373090dc07c6871 to your computer and use it in GitHub Desktop.
Save jonathanhle/b1f9bd8e5711be550373090dc07c6871 to your computer and use it in GitHub Desktop.
kafka_list_topics_to_check_ssl_port_msk
from confluent_kafka.admin import AdminClient
conf = {
'bootstrap.servers': 'b-6.yada-msk-cluster.hbmlgs.c1.kafka.us-east-1.amazonaws.com:9094,b-2.yada-msk-cluster.hbmlgs.c1.kafka.us-east-1.amazonaws.com:9094,b-1.yada-msk-cluster.hbmlgs.c1.kafka.us-east-1.amazonaws.com:9094',
'security.protocol': 'ssl',
'ssl.certificate.location': '/Users/jonathan.le/dev/certificate_stage.pem',
'ssl.key.location': '/Users/jonathan.le/dev/key_stage.pem'
}
kadmin = AdminClient(conf)
print(kadmin.list_topics().topics)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment