Interface ShareConsumerRecordRecoverer
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
A strategy interface for determining the acknowledgment action when a share
consumer record fails processing. Implementations decide whether to
ACCEPT, RELEASE,
or REJECT the failed record.
Built-in implementations: REJECTING (log and REJECT, default),
RELEASING (log and RELEASE for redelivery). Users can provide custom
implementations or use a lambda.
- Since:
- 4.1
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final org.springframework.core.log.LogAccessorLogger used by built-in implementations.static final ShareConsumerRecordRecovererRecoverer that logs the failure and REJECTs the record (archived, no redelivery).static final ShareConsumerRecordRecovererRecoverer that logs the failure and RELEASEs the record (available for redelivery). -
Method Summary
-
Field Details
-
LOGGER
static final org.springframework.core.log.LogAccessor LOGGERLogger used by built-in implementations. -
REJECTING
Recoverer that logs the failure and REJECTs the record (archived, no redelivery). This is the default when none is configured. -
RELEASING
Recoverer that logs the failure and RELEASEs the record (available for redelivery).
-
-
Method Details
-
recover
org.apache.kafka.clients.consumer.AcknowledgeType recover(org.apache.kafka.clients.consumer.ConsumerRecord<?, ?> record, Exception exception) Determine the acknowledgment action for a failed record.- Parameters:
record- the record that failed processingexception- the exception thrown during processing- Returns:
- the
AcknowledgeTypeto use — typically REJECT or RELEASE
-