Welcome to the Travel Bank Configuration Server, now upgraded to support dynamic runtime refresh, event-driven configuration updates, and health probes for better resilience and scalability across all microservices.
This project is an evolution of the following previous versions:
spring:
application:
name: "configserver"
profiles:
active: native
cloud:
config:
server:
native:
search-locations: "file:///D://GitHub_Public//configurationfiles"
server:
port: 8071
Each microservice like accounts
, loans
, and cards
now fetches configuration from this central server using:
spring.application.name=accounts
spring.config.import=optional:configserver:http://localhost:8071
In typical Spring Boot apps, config changes require a restart. Spring Cloud Config allows hot reload with the /refresh
or /busrefresh
endpoints:
-
Add actuator dependency to each microservice (
accounts
,loans
,cards
):<dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-actuator</artifactId> </dependency>
-
Enable refresh endpoint in
application.yml
:management: endpoints: web: exposure: include: refresh
-
Trigger refresh via POST:
curl -X POST http://localhost:<port>/actuator/refresh
-
✅ No restart required — configuration updates take effect immediately!
-
Add dependencies to all services:
<dependency> <groupId>org.springframework.cloud</groupId> <artifactId>spring-cloud-starter-bus-amqp</artifactId> </dependency>
-
Enable
busrefresh
endpoint inapplication.yml
:management: endpoints: web: exposure: include: busrefresh
-
Run RabbitMQ via Docker:
docker run -d -p 5672:5672 -p 15672:15672 --name rabbitmq rabbitmq:management
-
Trigger refresh across all services:
curl -X POST http://localhost:<port>/actuator/busrefresh
✅ Works across all instances and services connected to the Bus.
-
Add monitor dependency to the config server:
<dependency> <groupId>org.springframework.cloud</groupId> <artifactId>spring-cloud-config-monitor</artifactId> </dependency>
-
Enable
/monitor
endpoint (already enabled with actuator). -
Configure GitHub webhook:
- Target URL:
http://<config-server>/monitor
- Content Type:
application/json
- Trigger on:
push
- Target URL:
✅ When a change is pushed to GitHub config repo, refresh is automatically triggered across all services via RabbitMQ!
Spring Boot Actuator supports health probes to monitor container/app status:
Probe Type | Path | Description |
---|---|---|
Liveness | /actuator/health/liveness |
Is the app alive? Restart if fails |
Readiness | /actuator/health/readiness |
Can the app handle traffic? |
Enable in application.yml
:
management:
endpoint:
health:
probes:
enabled: true
endpoints:
web:
exposure:
include: health
GitHub Config Repo --> Push config
↓
Config Server <---- /refresh
↓
Microservice reloads updated config
GitHub Config Repo --> Push config
↓ webhook
Config Server <---- /monitor
↓ Bus Event
Microservices <---- /busrefresh (auto)
- 🔄 Real-time config refresh without restarts
- 🕸️ Event-driven updates with RabbitMQ
- 🛡️ Robust health checks via probes
- 📆 Git-based externalized config management (future)
- 🤖 Monitor-based automation with GitHub Webhooks
- ✅ Move to Git-based configuration source
- 🔒 Integrate Spring Cloud Vault for secrets
- 🌐 Deploy Config Server to AWS EC2 or EKS
- 🔐 Add role-based config access controls
We welcome contributions, feedback, and suggestions! Please feel free to fork, create issues, or open PRs.
MIT License © Vinay Steja
Built with ❤️ by Vinay Teja and Spring Cloud enthusiasts.