Can I use @RefreshScope (along with @Value on a property) only in Cloud config server or can I use without config server as well? I'm trying to use it without config server. I am trying to fetch @Value property by changing value in a .property file and trying to request again, will I get updated value? Is that possible?
No, you should use it along with Config server otherwise you won't be able to read the update properties on fly. Follow this article and have a look into this if you face any issue loading updated properties dynamically.
In theory, you could refresh the application context, but I wouldn't recommend this. Spring Cloud has provided an annotation to mark a bean as refreshable. By adding spring actuator, we can refresh those beans on the fly.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With