@Activate(group="consumer", value="actives") public class ActiveLimitFilter extends Object implements Filter, BaseFilter.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.
FilterBaseFilter.Listener| Constructor and Description |
|---|
ActiveLimitFilter() |
| Modifier and Type | Method and Description |
|---|---|
Result |
invoke(Invoker<?> invoker,
Invocation invocation)
Always call invoker.invoke() in the implementation to hand over the request to the next filter node.
|
void |
onError(Throwable t,
Invoker<?> invoker,
Invocation invocation)
This method will be called on detection of framework exceptions, for example, TimeoutException, NetworkException
Exception raised in Filters, etc.
|
void |
onResponse(Result appResponse,
Invoker<?> invoker,
Invocation invocation)
This method will only be called on successful remote rpc execution, that means, the service in on remote received
the request and the result (normal or exceptional) returned successfully.
|
public Result invoke(Invoker<?> invoker, Invocation invocation) throws RpcException
BaseFilterinvoke in interface BaseFilterRpcExceptionpublic void onResponse(Result appResponse, Invoker<?> invoker, Invocation invocation)
BaseFilter.ListeneronResponse in interface BaseFilter.Listenerpublic void onError(Throwable t, Invoker<?> invoker, Invocation invocation)
BaseFilter.ListeneronError in interface BaseFilter.ListenerCopyright © 2011–2022 The Apache Software Foundation. All rights reserved.