This microservices project consists of two main components: Limits Service and Spring Cloud Config Server. Below are details for each component:
The Limits Service is a microservice that provides information about configured limits. It exposes an endpoint /limits that returns a JSON object containing minimum and maximum values.
-
Application Properties:
spring.application.name=limits-servicespring.config.import = optional:configserver:http://localhost:8888spring.profiles.active=devspring.cloud.config.profile=qalimits-service.minimum = 3limits-service.maximum = 997
-
POM File: limits-service/pom.xml
-
Bean Class: xyz.deved.microservices.limitsservice.bean.Limits
-
Controller Class: xyz.deved.microservices.limitsservice.controller.LimitsController
-
Main Application Class: xyz.deved.microservices.limitsservice.LimitsServiceApplication
The Spring Cloud Config Server is responsible for providing centralized configuration for microservices. It is configured to retrieve configuration details from a Git repository.
-
Application Properties:
spring.application.name=spring-cloud-config-serverserver.port=8888spring.cloud.config.server.git.uri=file:///C:/Users/Edy/Desktop/git-localconfig-repo
-
POM File: spring-cloud-config/pom.xml
-
Main Application Class: xyz.deved.microservices.springcloudconfig.SpringCloudConfigApplication
-
Create a Folder and Initialize Git:
mkdir microservices-project cd microservices-project git init -
Create Limits Service Properties Files:
- Create
limits-service-qa.propertiesandlimits-service-dev.propertiesin the newly created folder. - Add the limits inside the folders like this
limits-service.minimum = 5 - limits-service.maximum = 995.
- Create
-
Commit to Local Repository:
git add . git commit -m "Initial commit with microservices project files"
-
Run Spring Cloud Config Server:
- Navigate to the
spring-cloud-configdirectory and run the Spring Cloud Config Server.
- Navigate to the
-
Run Limits Service:
- Navigate to the
limits-servicedirectory and run the Limits Service.
- Navigate to the
Feel free to modify this README based on your project's specific details.