You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@servicecomb.apache.org by "chenyang (Jira)" <ji...@apache.org> on 2022/08/02 01:12:00 UTC

[jira] [Created] (SCB-2658) RouteRule won't verify the lower priority rule when the higher priority rule didn't match

chenyang created SCB-2658:
-----------------------------

             Summary: RouteRule won't verify the lower priority rule when the higher priority rule didn't match
                 Key: SCB-2658
                 URL: https://issues.apache.org/jira/browse/SCB-2658
             Project: Apache ServiceComb
          Issue Type: Bug
          Components: Java-Chassis
    Affects Versions: java-chassis-2.7.0
            Reporter: chenyang
            Assignee: chenyang
             Fix For: java-chassis-2.8.0


@Component
public class RouterRuleMatcher {
private RouterRuleCache routerRuleCache;

@Autowired
public RouterRuleMatcher(RouterRuleCache routerRuleCache) {
this.routerRuleCache = routerRuleCache;
}

public RouterRuleMatcher() {
}

public PolicyRuleItem match(String serviceName, Map<String, String> invokeHeader) {
for (PolicyRuleItem rule : routerRuleCache.getServiceInfoCacheMap().get(serviceName)
.getAllrule()) {
if (rule.getMatch() == null || rule.getMatch().match(invokeHeader)) {
return rule;
}
}
return null;
}
}



--
This message was sent by Atlassian Jira
(v8.20.10#820010)