This repository is created to automate the topic creation process on Kafka for development environments, making it easier and more efficient.
To use this tool, follow these steps:
- Ensure you have Docker installed on your system.
- Create a topics.txt file
- Add your desired topics to the topics.txt file following the structure:
<topicName>:<partitions>:<replicationFactor>
- Run the provided Docker Compose example.
kafka_init:
image: egonzalezt/dev-kafka-topic-creator:latest
volumes:
- ./topics.txt:/scripts/topics.txt:ro
environment:
- FILE_PATH=/scripts/topics.txt
- BOOTSTRAP_SERVERS=kafka:9092
depends_on:
- kafka
networks:
- kafka
- Make sure to replace
./topics.txt
with the actual path to your topics.txt file. - Adjust the
BOOTSTRAP_SERVERS
environment variable if your Kafka broker is not running onkafka:9092
. - Adjust the
FILE_PATH
if you change the location of the file on the volume bind
The topics.txt file should have the following structure:
<topicName>:<partitions>:<replicationFactor>
<topicName>:<partitions>:<replicationFactor>
<topicName>:<partitions>:<replicationFactor>
...
Replace <topicName>
, <partitions>
, and <replicationFactor>
with your desired values for each topic.
This tool will read this file and automatically create topics with the specified configurations on your Kafka broker.
Feel free to contribute to this repository or report any issues you encounter!
CoplandFileManager is licensed under the Apache 2.0 license.