ExAzureCore.Http.Plugins.Retry (ex_azure_core v0.3.0)

Copy Markdown

Req plugin that implements Azure-specific retry logic.

Retries requests on transient failures with exponential backoff and jitter, respecting the Retry-After header when present.

Retryable Status Codes

  • 408 - Request Timeout
  • 429 - Too Many Requests
  • 500 - Internal Server Error
  • 502 - Bad Gateway
  • 503 - Service Unavailable
  • 504 - Gateway Timeout

Options

  • :max_retries - Maximum number of retry attempts (default: 3)
  • :base_delay - Base delay in milliseconds (default: 1000)
  • :max_delay - Maximum delay in milliseconds (default: 32000)
  • :retry_statuses - List of status codes to retry (default: [408, 429, 500, 502, 503, 504])

Example

req = Req.new()
|> ExAzureCore.Http.Plugins.Retry.attach(max_retries: 5)

Summary

Functions

Attaches the retry plugin to a Req request.

Functions

attach(request, opts \\ [])

@spec attach(
  Req.Request.t(),
  keyword()
) :: Req.Request.t()

Attaches the retry plugin to a Req request.