Skip to content

A Spring Cloud Config Server that serves as the centralized configuration management service for our fintech microservices ecosystem. 🏒

Notifications You must be signed in to change notification settings

Fintech-LSI/Config-server

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

63 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Config Server πŸ”§

A Spring Cloud Config Server that serves as the centralized configuration management service for our fintech microservices ecosystem. 🏒

Overview

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

Architecture

Config Server Architecture

The diagram above illustrates how the Config Server centralizes configuration management for all microservices in our ecosystem.

Project Structure

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

Tech Stack

  • Framework: Spring Cloud Config Server
  • Build Tool: Maven
  • Configuration Format: YAML
  • Server Port: 8889
  • Profile: Native (File System Based)

Features

  • 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

Getting Started

  1. Prerequisites

    • Java 17+
    • Maven
    • Git (for Git backend if used instead of native)
  2. Configuration

    server:
      port: 8889
    spring:
      profiles:
        active: native
      application:
        name: config-server
      cloud:
        config:
          server:
            native:
              search-locations: classpath:/configurations
  3. Local Development

    # Build the project
    mvn clean package
    
    # Run the Config Server (MUST BE STARTED FIRST)
    mvn spring-boot:run
  4. Verify Setup

    # Test configuration retrieval
    curl http://localhost:8889/{service-name}/{profile}

Configuration Files

Each microservice has its dedicated configuration file:

  • auth-service.yaml: Authentication service configurations
  • discovery-service.yaml: Service discovery settings
  • gateway-service.yaml: API Gateway routing rules
  • loans-service.yaml: Loan service parameters
  • And more...

Important Notes

  1. 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
  2. Configuration Updates

    • Changes to configuration files require either:
      • Service restart
      • Refresh scope trigger (POST /actuator/refresh)
    • Consider using Spring Cloud Bus for automated refreshes
  3. Security Considerations

    • Secure sensitive properties using encryption
    • Implement authentication for Config Server access
    • Use secure protocols for configuration retrieval

Monitoring

The Config Server exposes several endpoints for monitoring:

  • /actuator/health: Health check endpoint
  • /actuator/info: Information about the Config Server
  • /actuator/metrics: Metrics data

Troubleshooting

Common issues and solutions:

  1. Services Can't Connect

    • Verify Config Server is running
    • Check service bootstrap configuration
    • Ensure correct port configuration (8889)
  2. Configuration Not Found

    • Verify file exists in correct location
    • Check file naming convention
    • Confirm profile settings

πŸ‘₯ Team

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

Contributing

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/config-enhancement)
  3. Commit your changes (git commit -m 'Add new configuration feature')
  4. Push to the branch (git push origin feature/config-enhancement)
  5. Open a Pull Request

License

This project is licensed under the MIT License - see the LICENSE file for details.

About

A Spring Cloud Config Server that serves as the centralized configuration management service for our fintech microservices ecosystem. 🏒

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published