Last active
October 3, 2020 00:08
-
-
Save jonathanhle/b1f9bd8e5711be550373090dc07c6871 to your computer and use it in GitHub Desktop.
kafka_list_topics_to_check_ssl_port_msk
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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