RetryConfig

constructor(maxRetries: Int = 3, initialDelayMs: Long = 100, maxDelayMs: Long = 2000, retryableStatusCodes: Set<Int> = setOf(500, 502, 503, 504), retryableExceptions: Set<Class<out Throwable>> = setOf( java.net.ConnectException::class.java, java.net.SocketTimeoutException::class.java, java.io.IOException::class.java, ), nonRetryableExceptions: List<KClass<out Throwable>> = listOf())

Parameters

maxRetries

Maximum number of retry attempts (default: 3)

initialDelayMs

Initial delay before first retry in milliseconds (default: 100)

maxDelayMs

Maximum delay between retries in milliseconds (default: 2000)

retryableStatusCodes

HTTP status codes that should trigger retry (default: 5xx errors)

retryableExceptions

Exception types that should trigger retry (default: network exceptions)

nonRetryableExceptions

Exception types that must never be retried even if they extend a retryable type