Flow Example
This is an example of a fully configured Retry Flow that retries failed API requests based on status codes, with exponential backoff.
/etc/lunar-proxy/flows/flow.yaml
name: RetryFlow
filter:
  url: "api.com/resource/{id}"
processors:
  RetryProcessor:
    processor: Retry
    parameters:
      - key: attempts
        value: 5
      - key: cooldown_between_attempts_seconds
        value: 5
      - key: cooldown_multiplier
        value: 1.5
  FilterProcessor:
    processor: Filter
    parameters:
      - key: status_code_range
        value: 400-500
flow:
  request:
    - from:
        stream:
          name: globalStream
          at: start
      to:
        stream:
          name: globalStream
          at: end
  response:
    - from:
        stream:
          name: globalStream
          at: start
      to:
        processor:
          name: FilterProcessor
    - from: 
        processor:
          name: FilterProcessor
          condition: miss
      to:
        stream:
          name: globalStream
          at: end
    - from:
        processor:
          name: FilterProcessor
          condition: hit
      to:
        processor:
          name: RetryProcessor
    - from:
        processor:
          name: RetryProcessor
          condition: retry
        
      to:
        stream:
          name: globalStream
          at: end
    - from:
        processor:
          name: RetryProcessor
          condition: failed
      to:
        stream:
          name: globalStream
          at: end
Troubleshooting
- Retries Not Triggering:
- Verify that status_code_rangeis correctly configured.
- Ensure the API response status code falls within the specified range.
 
- Verify that 
- Excessive Retry Attempts:
- Check the attemptsparameter and reduce it if necessary.
- Adjust the cooldown_multiplierto increase wait times between retries.
- Make sure that in case of long cooldown the value of LUNAR_RETRY_REQUEST_TIMEOUT_SECis also increased. the default is100
 
- Check the