规制是否支持前置匹配?
- Dominant language
- Java
- Stars
- 23.1k
- Forks
- 8.1k
- PR merge metrics
- No merged PRs in 30d
Description
假如我有一个平台,使用者是不同的企业,如果我想针对某一资源根据不同的企业限流,配置规则可以前置匹配吗?
比如:配置resource=hello_可以针对以hello_开头的资源进行限流配置,因为没法为不同的企业单独配置(即使可以配置,这些限流规则除了资源名不同外,其他规则都是一样的)
public class Test {
private static final String RESOURCE_PREFIX = "hello_";
public void flow(String corpId) {
try {
if (!SphO.entry(RESOURCE_PREFIX + corpId)) {
return;
}
else {
//
}
} finally {
SphO.exit();
}
}
}
想请问下,sentinel目前支持这样的配置吗?如果支持,应该怎么配置?
Contributor guide
Research direction
Start with the Test entry point around SphO.entry(RESOURCE_PREFIX + corpId) and SphO.exit(), then inspect Sentinel's resource-rule configuration and matching behavior. Verify whether a resource value such as hello_ matches resources beginning with that prefix. Done means documenting the supported configuration or defining the implementation scope if prefix matching is not available.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- backend
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100