public abstract class FailedRecordProcessor
extends java.lang.Object
| Modifier and Type | Field and Description |
|---|---|
protected static org.springframework.core.log.LogAccessor |
LOGGER |
| Modifier | Constructor and Description |
|---|---|
protected |
FailedRecordProcessor(java.util.function.BiConsumer<org.apache.kafka.clients.consumer.ConsumerRecord<?,?>,java.lang.Exception> recoverer,
org.springframework.util.backoff.BackOff backOff) |
| Modifier and Type | Method and Description |
|---|---|
void |
addNotRetryableException(java.lang.Class<? extends java.lang.Exception> exceptionType)
Add an exception type to the default list; if and only if an external classifier
has not been provided.
|
void |
clearThreadState() |
protected org.springframework.classify.BinaryExceptionClassifier |
getClassifier()
Return the exception classifier.
|
protected java.util.function.BiPredicate<org.apache.kafka.clients.consumer.ConsumerRecord<?,?>,java.lang.Exception> |
getSkipPredicate(java.util.List<org.apache.kafka.clients.consumer.ConsumerRecord<?,?>> records,
java.lang.Exception thrownException) |
protected boolean |
isCommitRecovered()
Whether the offset for a recovered record should be committed.
|
boolean |
removeNotRetryableException(java.lang.Class<? extends java.lang.Exception> exceptionType)
Remove an exception type from the configured list; if and only if an external
classifier has not been provided.
|
void |
setClassifications(java.util.Map<java.lang.Class<? extends java.lang.Throwable>,java.lang.Boolean> classifications,
boolean defaultValue)
Set an exception classifications to determine whether the exception should cause a retry
(until exhaustion) or not.
|
protected void |
setClassifier(org.springframework.classify.BinaryExceptionClassifier classifier) |
void |
setCommitRecovered(boolean commitRecovered)
Set to true to commit the offset for a recovered record.
|
protected FailedRecordProcessor(@Nullable
java.util.function.BiConsumer<org.apache.kafka.clients.consumer.ConsumerRecord<?,?>,java.lang.Exception> recoverer,
org.springframework.util.backoff.BackOff backOff)
protected org.springframework.classify.BinaryExceptionClassifier getClassifier()
public void setClassifications(java.util.Map<java.lang.Class<? extends java.lang.Throwable>,java.lang.Boolean> classifications,
boolean defaultValue)
DeserializationExceptionMessageConversionExceptionMethodArgumentResolutionExceptionNoSuchMethodExceptionClassCastExceptionclassifications - the classifications.defaultValue - whether or not to retry non-matching exceptions.BinaryExceptionClassifier.BinaryExceptionClassifier(Map, boolean)protected void setClassifier(org.springframework.classify.BinaryExceptionClassifier classifier)
protected boolean isCommitRecovered()
public void setCommitRecovered(boolean commitRecovered)
commitRecovered - true to commit.public void addNotRetryableException(java.lang.Class<? extends java.lang.Exception> exceptionType)
DeserializationExceptionMessageConversionExceptionMethodArgumentResolutionExceptionNoSuchMethodExceptionClassCastExceptionexceptionType - the exception type.removeNotRetryableException(Class),
setClassifications(Map, boolean)public boolean removeNotRetryableException(java.lang.Class<? extends java.lang.Exception> exceptionType)
DeserializationExceptionMessageConversionExceptionMethodArgumentResolutionExceptionNoSuchMethodExceptionClassCastExceptionexceptionType - the exception type.addNotRetryableException(Class),
setClassifications(Map, boolean)protected java.util.function.BiPredicate<org.apache.kafka.clients.consumer.ConsumerRecord<?,?>,java.lang.Exception> getSkipPredicate(java.util.List<org.apache.kafka.clients.consumer.ConsumerRecord<?,?>> records,
java.lang.Exception thrownException)
public void clearThreadState()