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 ...
| Constructor and Description |
|---|
ConditionStateRouter(org.apache.dubbo.common.URL url) |
ConditionStateRouter(org.apache.dubbo.common.URL url,
String rule,
boolean force,
boolean enabled) |
| Modifier and Type | Method and Description |
|---|---|
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, setUrlequals, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitstoppublic static final String NAME
public 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 in interface StateRouter<T>isRuntime in class AbstractStateRouter<T>Copyright © 2011–2020 The Apache Software Foundation. All rights reserved.