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, EOSMode)
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)
Deprecated.
in favor of
#process(List, Consumer, Exception, boolean,
EOSMode) . |
default 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,
ContainerProperties.EOSMode eosMode)
Process the remaining records.
|
@Deprecated 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(List, Consumer, Exception, boolean,
EOSMode)
.records
- the records.consumer
- the consumer.exception
- the exceptionrecoverable
- the recoverable.isProcessInTransaction()
default 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, ContainerProperties.EOSMode eosMode)
ContainerProperties.EOSMode
is ContainerProperties.EOSMode.BETA
). So, generally, only its offset should
be sent to the transaction. For other behavior the process method should manage its
own transaction.records
- the records.consumer
- the consumer.exception
- the exceptionrecoverable
- the recoverable.eosMode
- the ContainerProperties.EOSMode
.isProcessInTransaction()
default void clearThreadState()
default boolean isProcessInTransaction()
#process(List, Consumer, Exception, boolean, EOSMode)
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, EOSMode)