We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
DefaultDiscoveryEnabledAdapter.java
if (StringUtils.isEmpty(versions)) { // 版本偏好,即非蓝绿灰度发布场景下,路由到老的稳定版本的实例 if (versionPreferEnabled) { return strategyVersionFilter.apply(server); } else { return true; } } else { // 版本故障转移,即无法找到相应版本的服务实例,路由到老的稳定版本的实例 if (versionFailoverEnabled) { List<ServiceInstance> instances = discoveryClient.getInstances(serviceId); boolean matched = false; for (ServiceInstance instance : instances) { if (strategyVersionFilter.applyVersion(instance)) { matched = true; break; } } if (!matched) { return strategyVersionFilter.apply(server); } } }
当 spring.application.strategy.version.prefer.enabled 和 spring.application.strategy.version.failover.enabled 未开启时,无法走到 DiscoveryClientDecorator.getInstances 所以也无法走到 VersionFilterDiscoveryListener。
The text was updated successfully, but these errors were encountered:
不好意思,迟至今日回复。DiscoveryClientDecorator中版本偏好和版本故障转移,它只是获取实例列表的一种策略手段
Sorry, something went wrong.
No branches or pull requests
DefaultDiscoveryEnabledAdapter.java
当 spring.application.strategy.version.prefer.enabled 和 spring.application.strategy.version.failover.enabled 未开启时,无法走到
DiscoveryClientDecorator.getInstances 所以也无法走到 VersionFilterDiscoveryListener。
The text was updated successfully, but these errors were encountered: