Class ActiveLimitFilter

java.lang.Object
org.apache.dubbo.rpc.filter.ActiveLimitFilter
All Implemented Interfaces:
BaseFilter, BaseFilter.Listener, Filter

@Activate(group="consumer", value="actives") public class ActiveLimitFilter extends Object implements Filter, BaseFilter.Listener
ActiveLimitFilter restrict the concurrent client invocation for a service or service's method from client side. To use active limit filter, configured url with actives and provide valid >0 integer value.
     e.g. invalid input: '<'dubbo:reference id="demoService" check="false" interface="org.apache.dubbo.demo.DemoService" "actives"="2"/>
      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.
 
See Also:
  • Nested Class Summary

    Nested classes/interfaces inherited from interface org.apache.dubbo.rpc.BaseFilter

    BaseFilter.Listener
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    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.

    Methods inherited from class java.lang.Object

    equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • ActiveLimitFilter

      public ActiveLimitFilter()
  • Method Details

    • invoke

      public Result invoke(Invoker<?> invoker, Invocation invocation) throws RpcException
      Description copied from interface: BaseFilter
      Always call invoker.invoke() in the implementation to hand over the request to the next filter node.
      Specified by:
      invoke in interface BaseFilter
      Throws:
      RpcException
    • onResponse

      public void onResponse(Result appResponse, Invoker<?> invoker, Invocation invocation)
      Description copied from interface: BaseFilter.Listener
      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.
      Specified by:
      onResponse in interface BaseFilter.Listener
      Parameters:
      appResponse - , the rpc call result, it can represent both normal result and exceptional result
      invoker - , context
      invocation - , context
    • onError

      public void onError(Throwable t, Invoker<?> invoker, Invocation invocation)
      Description copied from interface: BaseFilter.Listener
      This method will be called on detection of framework exceptions, for example, TimeoutException, NetworkException Exception raised in Filters, etc.
      Specified by:
      onError in interface BaseFilter.Listener
      Parameters:
      t - , framework exception
      invoker - , context
      invocation - , context