

GitHub - ehabqadah/spring-boot-microservices-best-practices: Best Practices for...
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
Management APIs
Local MySql Setup
Setup a local mysql container:
- Go into
docker-compose
directory under the root directory of the project - Use
docker-compose -p "sql" up -d
- Access http://localhost:8081/?server=db&username=exchange_rates
- Use
local_user/P@ssword1
as user/password credentials
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.
Recommend
-
14
Work in progress, this post is still in ‘work in progress’ status @Autowired Injection Avoid field and setter injection It should be used only for optional dependencies or in test code. Good...
-
9
Distributed Transactions in Microservices with Spring Boot When I’m talking about microservices with other people they are often asking me about approach to distributed transactions. My advice is always the same – try to
-
11
In this article I’m going to propose my list of “golden rules” for building Spring Boot applications, which are a part of microservices-based system. I’m basing on my experience in migrating monolithic SOAP applications runni...
-
12
Microservices with Spring Cloud Advanced Demo Project In this project I'm demonstrating you the most interesting features of Spring Cloud Project for building microservice-based...
-
11
Spring Boot Data Access Layer Best PracticesIn this article, we review best practices that are very effective to optimize spring boot data access layer.Spring boot JPA has added some interface on JP...
-
15
Spring Boot Testing Best PracticesLast Updated: May 3, 2023 | Published: May 3, 2023 Let's admit the truth. Testing is often an overlooked aspect of software development and an afterthought in most teams....
-
8
In this Spring Boot REST API Best Practices - Part-2, I will explain some of the best practices we should follow while implementing Create and Update API endpoints.This article is a continuation of
-
7
In this Spring Boot REST API Best Practices Series, I will explain some of the best practices we should follow while implementing REST APIs. Also, I will explain some of the common mistakes developers do and how to avoid them....
-
13
SivaLabsJava, Spring Boot, Microservices, Cloud and DevOps TutorialsShare this post:
-
9
In this Spring Boot REST API Best Practices - Part-3, we will see how to implement FindById and DeleteById API endpoints.You can find the sample code for this tutorial in this
About Joyk
Aggregate valuable and interesting links.
Joyk means Joy of geeK