Add Spring Cloud Config Server for centralized configuration management#10
Add Spring Cloud Config Server for centralized configuration management#10devin-ai-integration[bot] wants to merge 2 commits into
Conversation
- Created Config-Server microservice with Spring Cloud Config Server dependency - Implemented ConfigServerApplication with @EnableConfigServer annotation - Configured native profile for filesystem-based configuration storage - Created centralized configuration files for all 7 microservices: * service-registry.yml * api-gateway.yml * user-service.yml * account-service.yml * fund-transfer-service.yml * transaction-service.yml * sequence-generator.yml - Standardized environment variable substitution across all configs: * Database: MYSQL_HOST, MYSQL_PORT, MYSQL_DB_NAME, MYSQL_USER, MYSQL_PASSWORD * Keycloak: KEYCLOAK_CLIENT_SECRET, KEYCLOAK_API_CLIENT_SECRET (required env vars) - Added spring-cloud-starter-config dependency to all 7 microservices - Created bootstrap.yml files for all services to connect to Config Server - Added Dockerfile for Config-Server following existing service patterns - Added comprehensive README.md for Config-Server - Preserved all existing application.yml files as fallback configuration Config Server runs on port 8888 (standard Spring Cloud Config port) Recommended startup order: Service Registry → Config Server → Other services All services verified to compile successfully with new configuration approach. Link to Devin run: https://app.devin.ai/sessions/3105908d0528476ba646be704e6815e4 Requested by: Sam Fertig (@samfert-codeium) Co-Authored-By: Sam Fertig <sam.fertig@codeium.com>
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
There was a problem hiding this comment.
Pull Request Overview
This PR introduces a centralized configuration management system for the banking microservices application using Spring Cloud Config Server. The implementation enables all 7 microservices to retrieve their configurations from a central location while maintaining backward compatibility with local configuration files.
- Implements a new Config Server microservice with native file-based configuration storage
- Updates all client services to connect to the Config Server via Spring Cloud Config Client
- Migrates configuration files to a centralized location with environment variable support for database credentials and Keycloak secrets
Reviewed Changes
Copilot reviewed 26 out of 26 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| Config-Server/pom.xml | New Maven configuration for Config Server with Spring Cloud Config Server dependency |
| Config-Server/src/main/java/org/training/config/server/ConfigServerApplication.java | Main application class with @EnableConfigServer annotation |
| Config-Server/src/main/resources/application.yml | Config Server settings using native profile with classpath config location |
| Config-Server/src/main/resources/config/*.yml | Centralized configuration files for all 7 microservices |
| */src/main/resources/bootstrap.yml | Bootstrap configurations for each service to connect to Config Server |
| */pom.xml | Added spring-cloud-starter-config dependency to all client services |
| Config-Server/README.md | Comprehensive documentation for the Config Server |
| Config-Server/Dockerfile | Docker configuration for containerized deployment |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
| uri: lb://transaction-service | ||
| predicates: | ||
| - Path=/transactions/** | ||
| - id: fund-transfer-service |
There was a problem hiding this comment.
Duplicate route definition for fund-transfer-service. There are two routes with the same ID (lines 26-29 and 42-45) but different path patterns. This creates a duplicate route ID which could cause routing conflicts or unexpected behavior.
| - id: fund-transfer-service | |
| - id: fund-transfer-service-no-api |
|
|
||
| show-sql: true | ||
|
|
There was a problem hiding this comment.
[nitpick] Inconsistent YAML formatting with unnecessary blank lines within the jpa configuration block. The indentation structure should be consistent without extra blank lines between related properties.
| show-sql: true | |
| show-sql: true |
Address PR review comments: - Rename duplicate route ID 'fund-transfer-service' to 'fund-transfer-service-direct' for the /fund-transfers/** path in api-gateway.yml (line 42) - Remove unnecessary blank lines in fund-transfer-service.yml JPA configuration block (lines 18, 20) This fixes a pre-existing bug where two routes had the same ID, which could cause routing conflicts in Spring Cloud Gateway. Co-Authored-By: Sam Fertig <sam.fertig@codeium.com>
Add Spring Cloud Config Server for Centralized Configuration Management
Summary
This PR introduces a new Config Server microservice that centralizes configuration management for all services in the BankingMicroservices application. All 7 existing microservices have been updated to connect to the Config Server via
bootstrap.ymlfiles.Key Changes:
Config-Servermicroservice with Spring Cloud Config (native profile, port 8888)Config-Server/src/main/resources/config/spring-cloud-starter-configdependency andbootstrap.ymlto all 7 servicesfund-transfer-servicein API Gateway (renamed second one tofund-transfer-service-direct)Modified Services:
Review & Testing Checklist for Human
KEYCLOAK_CLIENT_SECRET(for API Gateway)KEYCLOAK_API_CLIENT_SECRET(for User Service)/api/fund-transfers/**and/fund-transfers/**paths work correctly through API GatewayTest Plan Recommendation
Notes
application.ymlfiles remain as fallback configurationLink to Devin run: https://app.devin.ai/sessions/3105908d0528476ba646be704e6815e4
Requested by: Sam Fertig (@samfert-codeium)