This project is a structure to practicing and studying the Kafka and KsqlDB environments. With container to setup Kafka, Zookeeper, KsqlDB server and KsqlDB CLI to manage Kafka.
The producers in this project are using the help of an API rest, with a post request to send messages to a Kafka topic.
$ cd producers
$ npm run start
$ curl --location --request POST 'http://localhost:3000/' \
--header 'Content-Type: application/json' \
--data-raw '{
"message": "message text"
}'
Have a postman collection at the root of the project Kafka-Project.postman_collection.json
.
The consumers is like a listeners, who will receive messages from a Kafka topic.
$ cd consumers
$ npm run start
On src/index.ts
file, can configure the consumers, editing their Id's and groupId's for each one.
the KsqlDB CLI container will provider a command line to manage KsqlDB server.
$ docker-compose exec ksqldb-cli ksql http://ksqldb-server:8088