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) |
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)
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)
FailedMessageRetryHandler
message with messageId failed in the spout
failed
in interface FailedMessageRetryHandler
public void acked(KinesisMessageId messageId)
FailedMessageRetryHandler
message with messageId succeeded/acked in the spout
acked
in interface FailedMessageRetryHandler
public KinesisMessageId getNextFailedMessageToRetry()
FailedMessageRetryHandler
Get the next failed message’s id to retry if any, null otherwise
getNextFailedMessageToRetry
in interface FailedMessageRetryHandler
public void failedMessageEmitted(KinesisMessageId messageId)
FailedMessageRetryHandler
message with messageId returned by last call to getNextFailedMessageToRetry was emitted/retried by the spout
failedMessageEmitted
in interface FailedMessageRetryHandler
Copyright © 2019 The Apache Software Foundation. All Rights Reserved.