Created
November 29, 2021 05:45
-
-
Save luccabb/71f593f7717853568c26d1c95ec019bf to your computer and use it in GitHub Desktop.
This file contains 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 kafka.admin import KafkaAdminClient, NewTopic | |
admin_client = KafkaAdminClient( | |
bootstrap_servers="localhost:9093", | |
client_id='test' | |
) | |
topic_list = [] | |
topic_list.append(NewTopic(name="il181-topic", num_partitions=3, replication_factor=1)) | |
admin_client.create_topics(new_topics=topic_list, validate_only=False) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment