Configuration

Deep dive into arya-banking-configs, global defaults, and secrets injection.

Overview

arya-banking-configs is a pure configuration repository (it contains no Java code or build files). The Config Server automatically mirrors this repo and exposes its contents logically.

File Naming Convention

Spring Cloud Config Server resolves files hierarchically to merge properties. Files in the Git repo should be named according to the following conventions:

Pattern / FilenameLoaded By
application.ymlAll microservices (global defaults)
{application}.ymlOnly the specific microservice (e.g. user-service.yml)
{application}-{profile}.ymlOnly when a specific profile is active (e.g. user-service-docker.yml)

Properties defined in files lower down the hierarchy override the global defaults.


Global Defaults (application.yml)

The root application.yml file contains shared settings inherited by the entire Arya Banking ecosystem. Any configuration placed here does not need to be duplicated in individual microservices.

Eureka Client

Yaml code-highlight
eureka:
  client:
    service-url:
      defaultZone: http://localhost:8761/eureka
This value points all microservices to the service registry. It must be explicitly overridden via Docker Compose (`EUREKA_CLIENT_SERVICEURL_DEFAULTZONE`) or profile-specific configs when running in containerized environments.

Kafka & Schema Registry

Yaml code-highlight
spring:
  kafka:
    bootstrap-servers: localhost:9092
    properties:
      schema.registry.url: http://localhost:8081

Gateway Routes

The API Gateway routes are mapped centrally here for the arya-banking-api-gateway. Starting from Spring Cloud 2025.0.0, the route definitions use the webflux key structure rather than the older standard structure:

Yaml code-highlight
spring:
  cloud:
    gateway:
      server:
        webflux:
          routes:
            - id: user-service
              uri: http://localhost:8086
              predicates:
                - Path=/api/users/**,/api/security-details/**

Secrets Management

Database URIs and passwords intentionally omit hardcoded credentials in the repository to prevent leaking sensitive secrets to version control.

Yaml code-highlight
spring:
  data:
    mongodb:
      uri: mongodb+srv://admin:${spring.application.mongo-password}@bankingcluster.ayhvgpk.mongodb.net/${spring.application.database}

{{% alert icon="๐Ÿ”’" context="warning" %}} Security Pattern: Placeholders like ${spring.application.mongo-password} are not defined in this Git repo. Instead, they are injected dynamically at runtime by HashiCorp Vault via bootstrap.yaml inside each respective microservice! {{% /alert %}}