public class ExponentialBackoffRetrier extends Object implements FailedMessageRetryHandler, Serializable
| Constructor and Description |
|---|
ExponentialBackoffRetrier()
No args constructor that uses defaults of 100 ms for first retry, max retries of Long.MAX_VALUE and an exponential backoff of
Math.pow(2,i-1) secs for retry i where i = 2,3,.... |
ExponentialBackoffRetrier(Long initialDelayMillis,
Long baseSeconds,
Long maxRetries)
Creates a new exponential backoff retrier.
|
| Modifier and Type | Method and Description |
|---|---|
void |
acked(KinesisMessageId messageId)
message with messageId succeeded/acked in the spout.
|
boolean |
failed(KinesisMessageId messageId)
message with messageId failed in the spout.
|
void |
failedMessageEmitted(KinesisMessageId messageId)
message with messageId returned by last call to getNextFailedMessageToRetry was emitted/retried by the spout.
|
KinesisMessageId |
getNextFailedMessageToRetry()
Get the next failed message’s id to retry if any, null otherwise.
|
public ExponentialBackoffRetrier()
No args constructor that uses defaults of 100 ms for first retry, max retries of Long.MAX_VALUE and an exponential backoff of Math.pow(2,i-1) secs for retry i where i = 2,3,....
public ExponentialBackoffRetrier(Long initialDelayMillis, Long baseSeconds, Long maxRetries)
Creates a new exponential backoff retrier.
initialDelayMillis - delay in milliseconds for first retrybaseSeconds - base for exponent function in secondsmaxRetries - maximum number of retries before the record is discarded/ackedpublic boolean failed(KinesisMessageId messageId)
FailedMessageRetryHandlermessage with messageId failed in the spout.
failed in interface FailedMessageRetryHandlermessageId - the message idpublic void acked(KinesisMessageId messageId)
FailedMessageRetryHandlermessage with messageId succeeded/acked in the spout.
acked in interface FailedMessageRetryHandlermessageId - the message idpublic KinesisMessageId getNextFailedMessageToRetry()
FailedMessageRetryHandlerGet the next failed message’s id to retry if any, null otherwise.
getNextFailedMessageToRetry in interface FailedMessageRetryHandlerpublic void failedMessageEmitted(KinesisMessageId messageId)
FailedMessageRetryHandlermessage with messageId returned by last call to getNextFailedMessageToRetry was emitted/retried by the spout.
failedMessageEmitted in interface FailedMessageRetryHandlermessageId - the message idCopyright © 2021 The Apache Software Foundation. All rights reserved.