The project consists in two modules:
It is an spring-boot application serving properties using spring cloud config server
To start the service use
make run
The service
- will be available at port 8888
- will serve properties from the
*.properties
files in the https://github.com/rojoangel/camel-spring-config-poc github repo (although this PoC uses the same repo, think of it as a different repo from the one containing the applications code) - can be tested in the following urls
It is an apache camel spring boot application acting as client of the config-service
To start the application with the default
profile active use
make run
To start the application with the prod
profile active use
make run-prod
The application
- responds to GET requests to
- /health-property - where a property value is directly used in the camel route, and
- /health-bean - where a property value is used to initialize a bean and the retrieved in the camel route
and on the management port - 9999
- responds to GET requests to /actuator/health
- responds to GET requests to /actuator/env
- returns application information - including version - at /actuator/info
- refreshes its properties via POST requests to /actuator/refresh
To refresh the application properties use
curl localhost:9999/actuator/refresh -d {} -H "Content-Type: application/json"
The application exposes via HTTP all the management (actuator/*) endpoints - they can be discovered at /actuator/
Here the full list can be found at Spring Boot Actuator Endpoints
E.g. to change un runtime the logging level use
curl -i -X POST -H 'Content-Type: application/json' -d '{"configuredLevel": "INFO"}' http://localhost:9999/actuator/loggers/ROOT
To have the property values injected to a bean working the following needed to be done:
- Add the bean to the
refresh
scope - Configure the bean with
aop:scoped-proxy
- more details in Spring Config Client XML equivalent of @RefreshScope. - Resolve property values using the
@Value
annotation instead of injecting them via constructor or setter - more details in Refreshed property gets overridden with XML bean definitions