Skip to main content
Version: 0.9.x

Remedy Plugins

Remedy plugins make up for a significant part of Lunar's magic: they allow users to solve API consumption problems with a few lines of configuration.

How It Works

A remedy policy can be defined globally, or on a per-endpoint basis. When a new request arrives at Lunar, it first goes through the process of finding and applying relevant remedy policies. The result of this step might:

  • yield a Lunar-generated response, in which case the original API provider will not be called, or
  • modify the request/response before it goes out to the original API provider or right after it returns from it, or
  • do nothing, and simply forward the call to the original API provider

Similarly to requests, all responses pass through that engine before being returned back to callers. This is key in order for Lunar to work properly. Take the Response-Based Throttling remedy plugin for example: it needs to cache the initial throttled response in order to work properly.

Identifying Responses Generated by Lunar

In case Lunar generated the response for a certain transaction, the x-lunar-generated-response: true header will be added to that response.

Available Remedy Plugins

Lunar offers several remedy plugins that you can use in order to easily solve API consumption problems.

  1. Smart Caching Smart Caching Plugin optimizes API performance by caching and reusing unchanged data, reducing load and enhancing speed.
  2. Retry The Retry remedy plugin optimizes client-side retries, enhancing success rates by managing wait times and integrating with Interceptors.
  3. Authentication Mechanism Secure and versatile authentication mechanism offers dynamic control and customization of your company's sensitive data protection.
  4. API Account Orchestration API Account Orchestration optimizes application performance by balancing load across multiple accounts, enhancing response times.
  5. Strategy-Based Throttling Strategy Based Throttling regulates API request rates and volumes to optimize usage and prevent resource overload.
  6. Response-Based Throttling Response-Based Throttling reduces API cooldowns, streamlining service by managing retry limits efficiently, without code changes.
  7. Concurrency-Based Throttling Concurrency Based Throttling enforces a policy of API throttling which involves setting a limit on the number of concurrent API requests.
  8. Strategy-Based Queue Strategy Based Queue plugin prioritizes requests, managing processing through configurable window sizes, quotas, and TTL settings.

Remedy Chaining

In case more than one remedy policy was found, the result of their application will be combined. Read more about remedy chaining here.

Click me for guidance 😀