This file contains step-by-step instructions on how to run this playground project.
You need to install the following before running this playground project:
- Java 11
- Maven
- Docker
To run the local kafka setup using docker compose:
- Docker compose
Or if you prefer to run local setup using kubernetes:
- Kind
- Kubectl
You can run the local setup using kubernetes OR docker compose.
If you need a bit more context on how to run the local setup using kubernetes, you can read this Kubernetes post
- Open a terminal and cd to the
kubernetes
folder. - Inside
kubernetes
folder create a folder called "tmp"mkdir tmp
, this is where the storage will be automatically provisioned by the default Kind storage class. - Run kind specifying configuration:
kind create cluster --config=kind-config.yml
. This will start a kubernetes control plane + worker - Run kubernetes configuration for kafka
kubectl apply -f kafka-k8s
- When done stop kubernetes objects:
kubectl delete -f kafka-k8s
and then if you want also stop the kind cluster which: will also delete the storage on the host machine:kind delete cluster
- Run
docker-compose up -d
in the root folder of the project.
- Build the application:
mvn clean package
- Run it:
mvn spring-boot:run
Some sample calls are provided in the test-data.http
file. You can run those from IntelliJ directly or if you're using
VSCode you can run them after installing the http
extension (REST Client). You can also convert those simple callst to
curl or httpie commands if that's your preference.
If you want to send multiple messages I recommend that you also check Apache ab tool.