The parameter regions in theclient.getApplications() method represents remoteRegions, which indicates that the registry should not only retrieve and return a list of its own nodes, but also return a list of remoteRegions.
But config.getRegion() represents the local region, and if this parameter is included, the registry will continue to print:
No remote registry available for the remote region xxx
We should refer to com.netflix.discovery.DiscoveryClient#getAndStoreFullRegistry and use config.fetchRegistryForRemoteRegions() instead of it
The parameter
regions
in theclient.getApplications()
method represents remoteRegions, which indicates that the registry should not only retrieve and return a list of its own nodes, but also return a list of remoteRegions.But
config.getRegion()
represents the local region, and if this parameter is included, the registry will continue to print:No remote registry available for the remote region xxx
We should refer to
com.netflix.discovery.DiscoveryClient#getAndStoreFullRegistry
and useconfig.fetchRegistryForRemoteRegions()
instead of it