public final class RetryPolicy extends Object
Note: If no retry policy is specified when creating the QldbDriver
then a
Retry Policy created will be created with the default parameters.
DefaultQldbTransactionBackoffStrategy
The builder can be customized with the maximum number of retry attempts and the backoff strategy, used to compute the delay before the next retry request. Example:
RetryPolicy retryPolicy = RetryPolicy.builder().maxRetries(3).build()
QldbDriver QldbDriver = QldbDriver.builder()
.sessionClientBuilder(mockBuilder)
.ledger(LEDGER)
.transactionRetryPolicy(retryPolicy)
.maxConcurrentTransactions(TXN_LIMIT)
.build();
Modifier and Type | Class and Description |
---|---|
static class |
RetryPolicy.Builder |
Modifier and Type | Method and Description |
---|---|
static RetryPolicy.Builder |
builder()
Creates a builder instance of the RetryPolicy.
|
static RetryPolicy |
maxRetries(int maxRetries)
Factory method to create a RetryPolicy with the maximum retry number that a transaction will be executed.
|
static RetryPolicy |
none()
Factory method to create a RetryPolicy that will not retry.
|
public static RetryPolicy none()
public static RetryPolicy maxRetries(int maxRetries)
Factory method to create a RetryPolicy with the maximum retry number that a transaction will be executed.
Note: TheDefaultQldbTransactionBackoffStrategy
backoff strategy will be used when creating the
RetryPolicy with this method.maxRetries
- Maximum number of times that the transaction will be retried.public static RetryPolicy.Builder builder()