This project is a microservices architecture built using:
- Eureka Server for service discovery
- Spring Cloud Config Server for centralized configuration
- Spring Cloud Client to retrieve configurations
- H2 Database as an in-memory database
The project consists of the following services:
- Config Server - Centralized configuration stored in a GitHub repository.
- Service Main - The main service that fetches configurations from the Config Server.
- Service One - A microservice that depends on Service Main.
- Service Notification - A notification service that also depends on Service Main.
config-microservice-centralized/ # Configuration stored in GitHub repo
service.main/ # Main service (Eureka Server)
service-one/ # Dependent microservice
service.notification/ # Notification service
Ensure you have the following installed:
- JDK 17+
- Maven
- Docker (Optional, if running in containers)
The configuration files are stored in a GitHub repository: config-microservice-centralized
Ensure that service.main
, service.one
, and service.notification
fetch their configurations from this repository.
Navigate to the service.main
directory and run:
mvn spring-boot:run
This will start the Eureka Server and retrieve configurations from the Config Server.
Navigate to the service-one
directory and run:
mvn spring-boot:run
This service will register itself with the Eureka Server.
Navigate to the service.notification
directory and run:
mvn spring-boot:run
This service will also register itself with the Eureka Server.
- Eureka Dashboard:
http://localhost:8181
- Service Main:
http://localhost:8181
- Service One:
http://localhost:8881
- Service Notification:
http://localhost:8082
This project uses an in-memory H2 database. To access the H2 console, navigate to:
http://localhost:8881/h2-console
Use the following credentials:
- JDBC URL:
jdbc:h2:mem:tasks
- Username:
sa
- Password: (leave blank)
This setup ensures that all services fetch their configurations dynamically and register themselves with Eureka for service discovery. Modify the properties in the config-microservice-centralized
repository to manage configurations centrally.