K
- the key type.V
- the value type.@FunctionalInterface
public interface AfterRollbackProcessor<K,V>
Modifier and Type | Method and Description |
---|---|
default void |
clearThreadState()
Optional method to clear thread state; will be called just before a consumer
thread terminates.
|
default boolean |
isProcessInTransaction()
Return true to invoke
process(List, Consumer, Exception, boolean) in a new
transaction. |
void |
process(java.util.List<org.apache.kafka.clients.consumer.ConsumerRecord<K,V>> records,
org.apache.kafka.clients.consumer.Consumer<K,V> consumer,
java.lang.Exception exception,
boolean recoverable)
Process the remaining records.
|
void process(java.util.List<org.apache.kafka.clients.consumer.ConsumerRecord<K,V>> records, org.apache.kafka.clients.consumer.Consumer<K,V> consumer, java.lang.Exception exception, boolean recoverable)
records
- the records.consumer
- the consumer.exception
- the exceptionrecoverable
- the recoverable.isProcessInTransaction()
default void clearThreadState()
default boolean isProcessInTransaction()
process(List, Consumer, Exception, boolean)
in a new
transaction. Because the container cannot infer the desired behavior, the processor
is responsible for sending the offset to the transaction if it decides to skip the
failing record.process(List, Consumer, Exception, boolean)