public class ConditionStateRouter<T> extends AbstractStateRouter<T>
By default, condition router support matching rules like 'foo=bar', 'foo=bar*', 'arguments[0]=bar', 'attachments[foo]=bar', 'attachments[foo]=1~100', etc.
It's also very easy to add customized matching rules by extending ConditionMatcherFactory
and ValuePattern
--- scope: service force: true runtime: true enabled: true key: org.apache.dubbo.samples.governance.api.DemoService conditions: - method=sayHello => region=hangzhou - method=sayHi => address=*:20881 ...
| 构造器和说明 |
|---|
ConditionStateRouter(org.apache.dubbo.common.URL url) |
ConditionStateRouter(org.apache.dubbo.common.URL url,
String rule,
boolean force,
boolean enabled) |
| 限定符和类型 | 方法和说明 |
|---|---|
void |
init(String rule) |
boolean |
isRuntime()
To decide whether this router need to execute every time an RPC comes or should only execute when addresses or
rule change.
|
buildSnapshot, getNextRouter, getRuleRepository, getUrl, isForce, notify, route, setForce, setNextRouter, setUrlstoppublic ConditionStateRouter(org.apache.dubbo.common.URL url,
String rule,
boolean force,
boolean enabled)
public ConditionStateRouter(org.apache.dubbo.common.URL url)
public void init(String rule)
public boolean isRuntime()
StateRouterisRuntime 在接口中 StateRouter<T>isRuntime 在类中 AbstractStateRouter<T>Copyright © 2011–2020 The Apache Software Foundation. All rights reserved.