Skip to content

Sample Spring Boot application that uses some features provided by Spring Cloud, deployed on Kubernetes.

License

Notifications You must be signed in to change notification settings

KnowHowSpringBoot/sample-mix-bookingdb

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Booking.com Static Data Handling Microservices

This example shows how to create a microservices architecture and deploy it with Kubernetes.

This project creates a complete microservice demo system in Docker containers. The services are implemented in Java using Spring and Spring Cloud.

It uses three microservices:

  • init-container-service to run the database migrations on deploy.
  • edge-service - provide API gateway, which supports reactive http communications to underlying service (dashboard), simple GraphQL interface to fetch countries, cities & hotels data.
  • importer-service to handle Booking.com API descriptive data (countries, cities, hotels lists).
  • dashboard-service provides API for frontend/end user interactions.

Technology stack

java 21, Maven 3, Spring Boot, Spring Cloud, mysql:5.7.43, rabbitmq:3.8

Including utils: liquibase, WireMock, Mysql testcontainers, docker-compose.dev.yml, checkstyle configuration, SpotBugs, PMD etc.

Pre-requisites

Start Kubernetes cluster

cd ./src/main/kubernetes-minikube-samples/scripts/
./start-cluster.sh

Configure Kubernetes cluster

cd ./src/main/kubernetes-minikube-samples/scripts/
./setup-cluster.sh

Deploy application to Kubernetes cluster

cd ./src/main/kubernetes-minikube-samples/scripts/
./install-all.sh

Undeploy application from Kubernetes cluster

cd ./src/main/kubernetes-minikube-samples/scripts/
./delete-all.sh

Delete Application specific Kubernetes cluster configuration (namespaces, clusterRole, etc.)

cd ./src/main/kubernetes-minikube-samples/scripts/
./destroy-cluster.sh

Stop Kubernetes cluster

cd ./src/main/kubernetes-minikube-samples/scripts/
./stop-cluster.sh

Code conventions

The code follows Google Code Conventions. Code quality is measured by:

Tests

This project has standard JUnit tests. To run them execute this command:

./mvnw verify -P use-testcontainers

Versioning

Project uses a three-segment CalVer scheme, with a short year in the major version slot, short month in the minor version slot, and micro/patch version in the third and final slot.

YY.MM.MICRO
  1. YY - short year - 6, 16, 106
  2. MM - short month - 1, 2 ... 11, 12
  3. MICRO - "patch" segment