@Activate(group="consumer", value="actives") public class ActiveLimitFilter extends Object implements Filter, Filter.Listener
e.g.
In the above example maximum 2 concurrent invocation is allowed.
If there are more than configured (in this example 2) is trying to invoke remote method, then rest of invocation
will wait for configured timeout(default is 0 second) before invocation gets kill by dubbo.
FilterFilter.Listener| 构造器和说明 |
|---|
ActiveLimitFilter() |
| 限定符和类型 | 方法和说明 |
|---|---|
Result |
invoke(Invoker<?> invoker,
Invocation invocation)
Make sure call invoker.invoke() in your implementation.
|
void |
onError(Throwable t,
Invoker<?> invoker,
Invocation invocation) |
void |
onResponse(Result appResponse,
Invoker<?> invoker,
Invocation invocation) |
public Result invoke(Invoker<?> invoker, Invocation invocation) throws RpcException
Filterinvoke 在接口中 FilterRpcExceptionpublic void onResponse(Result appResponse, Invoker<?> invoker, Invocation invocation)
onResponse 在接口中 Filter.Listenerpublic void onError(Throwable t, Invoker<?> invoker, Invocation invocation)
onError 在接口中 Filter.ListenerCopyright © 2011–2021 The Apache Software Foundation. All rights reserved.