traefik/docs/content/middlewares/retry.md
Jean-Baptiste Doumenjou 3689990bd5 Enhance the Retry Middleware Documentation
Co-authored-by: Mathieu Lonjaret <mathieu.lonjaret@gmail.com>
2019-09-04 17:28:03 +02:00

1.2 KiB

Retry

Retrying until it Succeeds {: .subtitle }

TODO: add schema

The Retry middleware is in charge of reissuing a request a given number of times to a backend server if that server does not reply. To be clear, as soon as the server answers, the middleware stops retrying, regardless of the response status.

Configuration Examples

# Retry to send request 4 times
labels:
- "traefik.http.middlewares.test-retry.retry.attempts=4"
# Retry to send request 4 times
apiVersion: traefik.containo.us/v1alpha1
kind: Middleware
metadata:
  name: test-retry
spec:
  retry:
    attempts: 4
"labels": {
  "traefik.http.middlewares.test-retry.retry.attempts": "4"
}
# Retry to send request 4 times
labels:
- "traefik.http.middlewares.test-retry.retry.attempts=4"
# Retry to send request 4 times
[http.middlewares]
  [http.middlewares.test-retry.retry]
     attempts = 4
# Retry to send request 4 times
http:
  middlewares:
    test-retry:
      retry:
       attempts: 4

Configuration Options

attempts

mandatory

The attempts option defines how many times the request should be retried.