Interface RateLimitingStrategy

    • Method Detail

      • registerInFlightRequest

        void registerInFlightRequest​(RequestInfo requestInfo)
        Registers the information of requests being sent (e.g. to track the current inFlightMessages / requests).
        Parameters:
        requestInfo - Data class containing information on request being sent
      • registerCompletedRequest

        void registerCompletedRequest​(ResultInfo resultInfo)
        Registers the result of completed requests (e.g. to track the current inFlightMessages / requests). Any dynamic scaling on failed messages should be done here.
        Parameters:
        resultInfo - Data class containing information on request completed
      • shouldBlock

        boolean shouldBlock​(RequestInfo requestInfo)
        Decides whether the next request should be blocked.
        Parameters:
        requestInfo - Data class containing information on request being sent
      • getMaxBatchSize

        int getMaxBatchSize()
        Returns the current max batch size that RateLimitingStrategy will allow through. This is required so that the component that constructs the ResultInfo that is passed into shouldBlock(RequestInfo) can construct a passable ResultInfo.