@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 .
+To refresh an individual bean by name, there is also a refresh(String) method.
To expose the /refresh endpoint, you need to add following configuration to your application: management:
+ endpoints:
+ web:
+ exposure:
+ include: refresh ![[Note]](images/note.png) | Note |
---|
@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 refreshed @Configuration ).
|
1.9 Encryption and DecryptionSpring Cloud has an Environment pre-processor for decrypting property values locally.
It follows the same rules as the Config Server and has the same external configuration through encrypt.* .
diff --git a/single/spring-cloud-commons.html b/single/spring-cloud-commons.html
index 70da86a1..7cf12dee 100644
--- a/single/spring-cloud-commons.html
+++ b/single/spring-cloud-commons.html
@@ -76,8 +76,12 @@ For instance, if a DataSource has open connections
Then, the next time something borrows a connection from the pool, it gets one with the new URL. Refresh scope beans are lazy proxies that initialize when they are used (that is, when a method is called), and the scope acts as a cache of initialized values.
To force a bean to re-initialize on the next method call, you must invalidate its cache entry. The RefreshScope is a bean in the context and has a public refreshAll() method to refresh all beans in the scope by clearing the target cache.
The /refresh endpoint exposes this functionality (over HTTP or JMX).
-To refresh an individual bean by name, there is also a refresh(String) method. ![[Note]](images/note.png) | Note |
---|
@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 .
+To refresh an individual bean by name, there is also a refresh(String) method.
To expose the /refresh endpoint, you need to add following configuration to your application: management:
+ endpoints:
+ web:
+ exposure:
+ include: refresh ![[Note]](images/note.png) | Note |
---|
@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 refreshed @Configuration ).
|
1.9 Encryption and DecryptionSpring Cloud has an Environment pre-processor for decrypting property values locally.
It follows the same rules as the Config Server and has the same external configuration through encrypt.* .
diff --git a/spring-cloud-commons.xml b/spring-cloud-commons.xml
index 7ba8f485..68a1828b 100644
--- a/spring-cloud-commons.xml
+++ b/spring-cloud-commons.xml
@@ -184,9 +184,15 @@ To force a bean to re-initialize on the next method call, you must invalidate it
The RefreshScope is a bean in the context and has a public refreshAll() method to refresh all beans in the scope by clearing the target cache.
The /refresh endpoint exposes this functionality (over HTTP or JMX).
To refresh an individual bean by name, there is also a refresh(String) method.
+To expose the /refresh endpoint, you need to add following configuration to your application:
+management:
+ endpoints:
+ web:
+ exposure:
+ include: refresh
@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.
+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 refreshed @Configuration).
|
|