SpotifyRetryConfig

data class SpotifyRetryConfig(val maxRetries: Int = 3, val retryOnRateLimit: Boolean = true, val retryOnConnectionException: Boolean = true, val retryOnServerErrorsForSafeMethods: Boolean = true, val respectRetryAfterHeader: Boolean = true, val baseDelayMillis: Long = 500, val maxDelayMillis: Long)

Retry policy for SpotifyHttpClientFactory-built clients.

Parameters

maxRetries

Maximum number of retry attempts per request.

retryOnRateLimit

Retry on HTTP 429 (Too Many Requests) responses.

retryOnConnectionException

Retry when the request fails before a response is received (for example connection refused or DNS failure).

retryOnServerErrorsForSafeMethods

Retry on HTTP 5xx responses, but only for idempotent methods (GET/PUT/DELETE). A 5xx on POST (for example queueing a track) is never retried, since that could double-execute a non-idempotent operation.

respectRetryAfterHeader

Honor the Retry-After response header when present instead of the exponential backoff delay.

baseDelayMillis

Base delay used by the exponential backoff between retries.

maxDelayMillis

Upper bound applied to the computed retry delay.

Constructors

Link copied to clipboard
constructor(maxRetries: Int = 3, retryOnRateLimit: Boolean = true, retryOnConnectionException: Boolean = true, retryOnServerErrorsForSafeMethods: Boolean = true, respectRetryAfterHeader: Boolean = true, baseDelayMillis: Long = 500, maxDelayMillis: Long)

Properties

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
val maxRetries: Int = 3
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard