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: initial_cooldown_seconds
value: 1
- key: cooldown_multiplier
value: 1.5
- key: min_status_code
value: 502
- key: max_status_code
value: 504
metrics:
enabled: true
labels:
- flow_name
- processor_key
- http_method
- url
- status_code
flow:
request:
- from:
stream:
name: globalStream
at: start
to:
processor:
name: RetryProcessor
- from:
processor:
name: RetryProcessor
to:
stream:
name: globalStream
at: end
Troubleshooting
- Retries Not Triggering:
- Verify that
min_status_code
andmax_status_code
are correctly configured. - Ensure the API response status code falls within the specified range.
- Verify that
- Excessive Retry Attempts:
- Check the
attempts
parameter and reduce it if necessary. - Adjust the
cooldown_multiplier
to increase wait times between retries.
- Check the