Package markets.alpaca.client.http
Class AlpacaRetryPolicy.Builder
java.lang.Object
markets.alpaca.client.http.AlpacaRetryPolicy.Builder
- Enclosing class:
- AlpacaRetryPolicy
Builder for
AlpacaRetryPolicy.-
Method Summary
Modifier and TypeMethodDescriptionbuild()initialDelay(Duration initialDelay) Sets the first exponential-backoff delay.jitterRatio(double jitterRatio) Sets the jitter ratio added to computed backoff delays.listener(AlpacaRetryListener listener) Sets optional hooks for observing retry decisions.maxAttempts(int maxAttempts) Sets the total number of attempts, including the first request.Sets the maximum computed retry delay.retryableMethods(Collection<String> retryableMethods) Sets HTTP methods eligible for retry.retryableStatusCodes(Collection<Integer> retryableStatusCodes) Sets HTTP status codes eligible for retry.
-
Method Details
-
maxAttempts
Sets the total number of attempts, including the first request. Defaults to 3. -
initialDelay
Sets the first exponential-backoff delay. Defaults to 250 ms. -
maxDelay
Sets the maximum computed retry delay. Defaults to 5 seconds. -
jitterRatio
Sets the jitter ratio added to computed backoff delays. Defaults to 0.2. -
retryableMethods
Sets HTTP methods eligible for retry. Defaults to idempotent methods only. -
retryableStatusCodes
Sets HTTP status codes eligible for retry. -
listener
Sets optional hooks for observing retry decisions. -
build
-