A demo project that demonstrates the differences and similarities between the frameworks
Features:
- Controller
- REST interface to read all orders
- REST interface to post a new order
- New orders are send using Kafka to the order service
- Existing orders are gotten trough HTTP from the order service
- Service
- Postgres database
- Kafka consumer for new orders
- REST interface for all orders (use paging)
The Quarkus projects are created using the Quarkus CLI
The Spring Boot projects are created using the Spring Initializr
Both projects with Gradle and Kotlin options on
- Java
- Docker
- Kubectl
- Minikube
- JQ
There is an actions.sh script in /scripts. Use this to perform the following steps:
./actions.sh create-mountMake mounts for Minikube to store persistent data./actions.sh start-minikubeStart Minikube with the correct settings./actions.sh build-kafkaBuild a Kafka that works without Zookeeper./actions.sh start-kafkaStart Kafka in Minikube./actions.sh start-postgresStart Postgres in Minikube./actions.sh start-ingressStart Ingress in Minikube (if you run this on Apple Silicon then it will create a tunnel for Ingress and not come back with a prompt. (You also probably will be asked to enter the sudo password))./actions.sh refrest-servicesBuild and deploy all services to Minikube
There is an actions.sh script in /scripts. Use this to perform the following steps:
./actions.sh
First for spring-boot:
./actions.sh build-image spring-boot order-controller./actions.sh start-pods spring-boot order-controller
This will barely be able to start the pods in time and by doing so use a lot of resources../actions.sh replicas spring-boot order-controller 30
This will take forever with a lot ofCrashLoopBackOff. Better do this in small increments of 4 replicas a time../actions.sh drain
This will drain one of the nodes and move all pods to another node at once. See the load increase and wait forever for this to have all pods running again../actions.sh uncordonMake the node available again./actions.sh replicas spring-boot order-controller 1Scale back to one
Second for quarkus:
./action.sh build-image quarkus order-controller./action.sh start-pods quarkus order-controller
This will quickly start the pods and use little resources../action.sh replicas quarkus order-controller 30
There might be some restarts but it reaches the 30 pods quite quickly../action.sh drain
This will drain one of the nodes and move all pods to another node at once. See how quickly this finishes and moves all the drained pods to the other node../action.sh uncordonMake the node available again./action.sh replicas quarkus order-controller 1Scale back to one