We are externalizing configuration of our microservices (spring boot based) using spring cloud.
As per my understanding on Spring Cloud, to enable the beans loading refreshed/updated values from Config server we need to do 2 things in Spring Cloud Client:
- add
@RefreshScopeon the beans reading values from property files using@Value - add spring actuator to provide /refresh endpoint to refresh the context.
Scenario: We have 100s of classes reading values from property file using @Value. I have to mark all these beans refresh enabled using @RefreshScope annotation.
How can I avoid putting @RefreshScope annotation on all these classes.
Is there any shortcut or spring cloud feature to get around this situation.