Retry

重试直到成功

如果后端服务器未响应,则重试中间件负责将请求重新发出给定次数. 需要明确的是,服务器响应后,无论响应状态如何,中间件都将停止重试.

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

attempts选项定义应重试请求的次数.