Mình đang đọc trên doc: https://cloud.spring.io/spring-cloud-static/Greenwich.SR2/multi/multi__spring_cloud_context_application_context_services.html
RefreshScope
works (technically) on an@Configuration
class, but it might lead to surprising behavior. For example, it does not mean that all the@Beans
defined in that class are themselves in@RefreshScope
. Specifically, anything that depends on those beans cannot rely on them being updated when a refresh is initiated, unless it is itself in@RefreshScope
. In that case, it is rebuilt on a refresh and its dependencies are re-injected. At that point, they are re-initialized from the refreshedConfiguration
).
Mình vẫn chưa hiểu rõ về @RefreshScope
tại class và mỗi bean từ đoạn trên. Mong mọi người có thể giải thích để mình hiểu rõ hơn. Cám ơn mọi người !