Add some documentation about the property eureka.client.refresh.enable
This commit is contained in:
@@ -324,6 +324,19 @@ eureka.instance.metadataMap.zone = zone2
|
||||
eureka.client.preferSameZoneEureka = true
|
||||
```
|
||||
|
||||
=== Refresh Scope of Eureka Client
|
||||
|
||||
By default, the `EurekaClient` bean is refreshable, so the Eureka client properties can be refreshed, but this has a disadvantage:
|
||||
with the default setting, the `EurekaClient` instance will be destroyed and reconstructed again when refreshed, so your program will unregister from eurekaServer and after some seconds, it will register to eurekaServer again,
|
||||
consider that when we refresh all of the `Service A` instances at the same time, there will be some seconds no one instance alive on eurekaServer, if at the same time, `Service B` tries to fetch instances of `Service A`,
|
||||
it will fetch an empty list. If you don't want to see this, you can set `eureka.client.refresh.enable=false` in the application properties to make the `EurekaClient` instance immutable,
|
||||
but notice that if you set this property to false, none of the Eureka client properties will be refreshable.
|
||||
|
||||
*application.properties. *
|
||||
```
|
||||
eureka.client.refresh.enable=false
|
||||
```
|
||||
|
||||
[[spring-cloud-eureka-server]]
|
||||
== Service Discovery: Eureka Server
|
||||
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
{
|
||||
"defaultValue": true,
|
||||
"name": "eureka.client.refresh.enable",
|
||||
"description": "Determines whether EurekaClient instance can be refreshed or not.",
|
||||
"description": "Determines whether the EurekaClient instance can be refreshed or not(If disabled none of the Eureka client properties will be refreshable).",
|
||||
"type": "java.lang.Boolean"
|
||||
},
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user