api-manager icon indicating copy to clipboard operation
api-manager copied to clipboard

Throttle Policy Reset Support for APIM

Open Chanuka-ChandraYapa opened this issue 1 year ago • 1 comments

Problem

API Manager currently cannot reset the request counters manually after or before the throttle policy limit has been reached within the throttling time window. The throttle policy limit can be reached due to spikes or unintended requests. Hence, API Users should wait until the throttling time period expires to invoke API calls again. In that case, there can be a requirement to allow further usage resuming API consumption for consumers seamlessly.

Solution

The proposed solution involves publishing a separate asynchronous reset event to the current Siddhi stream at the traffic manager. We are planning to use the existing Siddhi event stream process flow with additional changes to support resetting relevant counters. This approach involves changing the current execution plan format and creating a new data publisher to publish the reset event to the Siddhi runtime.

Affected Component

APIM

Version

4.2.0

Implementation

High level design for the proposed solution. image

Tasks to be done

Application Level Throttle Policy Reset

  • [x] Rest API implementation
  • [x] Notify the reset event to eventhub
  • [x] Publish the reset event fetched from event hub to Siddhi Stream
  • [x] Write Siddhi extensions to handle reset event
  • [x] Frontend Implementation
  • [x] Unit Testing
  • [x] Integration Testing
  • [ ] Update APIM docs

Related Issues

No response

Suggested Labels

No response

Chanuka-ChandraYapa avatar Feb 06 '24 05:02 Chanuka-ChandraYapa

Let's remove the deferred tasks from the issue description

rmsamitha avatar May 15 '24 14:05 rmsamitha