A Spring Cloud Config Server that serves as the centralized configuration management service for our fintech microservices ecosystem. π’
The Config Server is a critical infrastructure component that:
- π Centralizes configuration management for all microservices
- π Provides dynamic configuration updates
- π Secures sensitive configuration data
- β‘ Must be started first before other microservices
The diagram above illustrates how the Config Server centralizes configuration management for all microservices in our ecosystem.
src/main/java/com/fintech/config_server/
βββ ConfigServerApplication.java
βββ resources/
βββ configurations/ # Configuration files for all services
βββ auth-service.yaml
βββ discovery-service.yaml
βββ gateway-service.yaml
βββ loans-service.yaml
βββ notification-service.yaml
βββ transaction-service.yaml
βββ user-service.yaml
βββ wallet-service.yaml
- Framework: Spring Cloud Config Server
- Build Tool: Maven
- Configuration Format: YAML
- Server Port: 8889
- Profile: Native (File System Based)
- Centralized Configuration: Single source of truth for all microservice configurations
- Profile Management: Support for different environments (dev, prod, etc.)
- Native Profile: File system based configuration storage
- Real-time Updates: Configuration changes without service restarts
- Security: Encrypted sensitive properties
-
Prerequisites
- Java 17+
- Maven
- Git (for Git backend if used instead of native)
-
Configuration
server: port: 8889 spring: profiles: active: native application: name: config-server cloud: config: server: native: search-locations: classpath:/configurations
-
Local Development
# Build the project mvn clean package # Run the Config Server (MUST BE STARTED FIRST) mvn spring-boot:run
-
Verify Setup
# Test configuration retrieval curl http://localhost:8889/{service-name}/{profile}
Each microservice has its dedicated configuration file:
auth-service.yaml: Authentication service configurationsdiscovery-service.yaml: Service discovery settingsgateway-service.yaml: API Gateway routing rulesloans-service.yaml: Loan service parameters- And more...
-
Startup Order
- Config Server must be started FIRST
- Other services should start AFTER Config Server is running
- Services will fail to start if Config Server is unavailable
-
Configuration Updates
- Changes to configuration files require either:
- Service restart
- Refresh scope trigger (
POST /actuator/refresh)
- Consider using Spring Cloud Bus for automated refreshes
- Changes to configuration files require either:
-
Security Considerations
- Secure sensitive properties using encryption
- Implement authentication for Config Server access
- Use secure protocols for configuration retrieval
The Config Server exposes several endpoints for monitoring:
/actuator/health: Health check endpoint/actuator/info: Information about the Config Server/actuator/metrics: Metrics data
Common issues and solutions:
-
Services Can't Connect
- Verify Config Server is running
- Check service bootstrap configuration
- Ensure correct port configuration (8889)
-
Configuration Not Found
- Verify file exists in correct location
- Check file naming convention
- Confirm profile settings
| Avatar | Name | Role | GitHub |
|---|---|---|---|
![]() |
Zakariae Azarkan | DevOps Engineer | @zachary013 |
![]() |
El Mahdi Id Lahcen | Frontend Developer | @goalaphx |
![]() |
Hodaifa | Cloud Architect | @hodaifa-ech |
![]() |
Khalil El Houssine | Backend Developer | @khalilh2002 |
![]() |
Mohamed Amine BAHASSOU | ML Engineer | @Medamine-Bahassou |
- Fork the repository
- Create a feature branch (
git checkout -b feature/config-enhancement) - Commit your changes (
git commit -m 'Add new configuration feature') - Push to the branch (
git push origin feature/config-enhancement) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.





