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 (Confluent Cloud)

> Yaml code-highlight
client:
  id: ccloud-springboot-client-311f578c-748a-4f31-8f1d-295ca7dd1828
spring:
  kafka:
    bootstrap-servers: pkc-41p56.asia-south1.gcp.confluent.cloud:9092
    properties:
      schema.registry.url: https://psrc-81q7m7.asia-south1.gcp.confluent.cloud
      sasl:
        mechanism: PLAIN
        jaas:
          config: org.apache.kafka.common.security.plain.PlainLoginModule required username='${confluent.kafka.api.key}' password='${confluent.kafka.api.secret}';
      security:
        protocol: SASL_SSL
      session:
        timeout:
          ms: 45000
      basic:
        auth:
          credentials:
            source: USER_INFO
          user:
            info: ${confluent.kafka.schema.key}:${confluent.kafka.schema.secret}

confluent.kafka.api.* / confluent.kafka.schema.* are Vault-injected (via spring-cloud-starter-vault-config in each service) โ€” no secrets are hard-coded in this repo. Each service declares only the confluent: placeholder block in its local application.yaml and inherits the broker/SASL wiring above from Config Server.

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: lb://arya-banking-user-service
              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}
๐Ÿ”’

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!