Skip to content

Commit

Permalink
Merge branch 'master' into fix-ext-plugin-path
Browse files Browse the repository at this point in the history
  • Loading branch information
Aias00 authored Nov 23, 2024
2 parents 286287d + 78d35a0 commit 80961ea
Showing 1 changed file with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
import org.apache.shenyu.plugin.apache.dubbo.handler.ApacheDubboPluginDataHandler;

import java.util.List;
import java.util.Objects;
import java.util.stream.Collectors;

/**
Expand All @@ -51,6 +52,9 @@ public <T> Invoker<T> select(final List<Invoker<T>> invokers, final URL url, fin
// if gray list is not empty,just use load balance to choose one.
if (CollectionUtils.isNotEmpty(dubboUpstreams)) {
Upstream upstream = LoadBalancerFactory.selector(UpstreamCacheManager.getInstance().findUpstreamListBySelectorId(shenyuSelectorId), dubboRuleHandle.getLoadBalance(), remoteAddressIp);
if (Objects.isNull(upstream)) {
return select(invokers, url, invocation, dubboRuleHandle.getLoadBalance());
}
if (StringUtils.isBlank(upstream.getUrl()) && StringUtils.isBlank(upstream.getGroup()) && StringUtils.isBlank(upstream.getVersion())) {
return select(invokers, url, invocation, dubboRuleHandle.getLoadBalance());
}
Expand Down

0 comments on commit 80961ea

Please sign in to comment.