6

GitHub - ehabqadah/spring-boot-microservices-best-practices: Best Practices for...

 2 years ago
source link: https://github.com/ehabqadah/spring-boot-microservices-best-practices
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

spring-boot-microservices-best-practices

Best Practices for Developing Rest-Based Microservices with Spring-Boot A service offers REST APIs for managing/consuming orders.

Owner

  • Ehab Qadah

Tools and Technologies Used

  • Spring Boot -2.4.0-SNAPSHOT

  • Maven

  • MYSQL

  • Swagger

  • Flywaydb

  • Hibernate 5

  • lighthouse-orm-commons

  • Docker and Docker Compose

Check out here for more details.

APIs documentation

LOCAL

Management APIs

actuator

Local MySql Setup

Setup a local mysql container:

Create local_user user and empty schema local_db by executing the following SQL commands:

CREATE USER IF NOT EXISTS  'local_user'@'%' IDENTIFIED BY 'P@ssword1';
CREATE DATABASE IF NOT EXISTS local_db CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
FLUSH PRIVILEGES;
GRANT ALL PRIVILEGES ON local_db.* TO 'local_user'@'%';

Docker Image

export IMAGE_NAME="<image-name>"
export GIT_COMMIT="<git-commit>"

docker build -t $IMAGE_NAME --build-arg GIT_COMMIT=$GIT_COMMIT  --build-arg ENVIRONMENT=local   .

Deployment

The micro-service can be deployed on a Kubernetes cluster using the DEPLOYMENT pipeline.


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK