- Use docker to deploy kafka with registry (Use reference project to download docker compose yml file).
docker compose -f zk-single-kafka-multiple-schema-registry-ui.yml up -d
Open UI for Apache Kafka at http://localhost:8084/.
- Run gradle build to generate avro source files
cd common-lib
gradle clean build
-
Run application
- order-service
cd order-service gradle clean bootRun
- payment-service
cd payment-service gradle clean bootRun
- stock-service
cd stock-service gradle clean bootRun
-
Use following request to generate orders
curl --location --request POST 'http://localhost:8080/orders/generate'
- Use following request to check orders status
curl --location --request GET 'http://localhost:8080/orders'
- Use ctrl+c to cancel running applications
- Use following command to stop and remove kafka containers
docker compose -f zk-single-kafka-multiple-schema-registry-ui.yml down
- Start kafka
helm repo add confluentinc https://confluentinc.github.io/cp-helm-charts/
helm repo update
helm install my-kafka -f ./k8s/kafka/values.yaml confluentinc/cp-helm-charts
- Application Deployment
gradle clean dockerTag
kubectl apply -f ./k8s/app
- Use following request to generate orders
curl --location --request POST 'http://localhost:30001/orders/generate'
- Use following request to check orders status
curl --location --request GET 'http://localhost:30001/orders'
- Clean up
kubectl delete -f ./k8s/app
helm delete my-kafka
- Expose Confluent Control Center via NodePort
kubectl patch svc my-kafka-cp-control-center --type='json' -p '[{"op":"replace","path":"/spec/type","value":"NodePort"}]'