This project includes a sample docker compose yml file which can be used to setup a local kafka env.
The project includes zookeeper and a single kafka node.
Clone this repo and run the following:
$ chmod +x make-commands-executable.sh
$ ./make-commands-executable.sh
You can then use the following commands:
- Kafka will start at port 9092
- Zookeeper will start at port 2181
$ ./start
$ ./stop
$ ./kafka/list-brokers
$ ./kafka/logs
$ ./kafka/version
$ ./kafka/shell
$ ./kafka/run-within-docker <the_command_that_you_would_like_to_run>
$ ./kafka/topic/list
- created with replication-factor 1 and partitions 1
$ ./kafka/topic/create <topic_name>
$ ./kafka/topic/details <topic_name>
$ ./kafka/topic/delete <topic_name>
$ ./kafka/topic/purge
$ ./kafka/topic/change-retention <topic_name> <retention_time_in_msec>
$ ./kafka/topic/increase-partition <topic_name> <new_partition_size>
- Each line is a new message, hit ctrl-c to end.
$ ./kafka/message/produce <topic_name>
$ ./kafka/message/consume <topic_name>
$ ./kafka/message/consume-from-beginning <topic_name>
$ ./zookeeper/logs
$ ./zookeeper/shell