Example usage for org.springframework.kafka.support SeekUtils doSeeks

List of usage examples for org.springframework.kafka.support SeekUtils doSeeks

Introduction

In this page you can find the example usage for org.springframework.kafka.support SeekUtils doSeeks.

Prototype

public static boolean doSeeks(List<ConsumerRecord<?, ?>> records, Consumer<?, ?> consumer, Exception exception,
        boolean recoverable, BiPredicate<ConsumerRecord<?, ?>, Exception> skipper, LogAccessor logger) 

Source Link

Document

Seek records to earliest position, optionally skipping the first.

Usage

From source file:org.springframework.kafka.listener.DefaultAfterRollbackProcessor.java

@SuppressWarnings({ "unchecked", "rawtypes" })
@Override/*ww  w  .ja  va 2  s.  c o  m*/
public void process(List<ConsumerRecord<K, V>> records, Consumer<K, V> consumer, Exception exception,
        boolean recoverable) {
    SeekUtils.doSeeks(((List) records), consumer, exception, recoverable, this.failureTracker::skip, logger);
}

From source file:org.springframework.kafka.listener.SeekToCurrentErrorHandler.java

@Override
public void handle(Exception thrownException, List<ConsumerRecord<?, ?>> records, Consumer<?, ?> consumer,
        MessageListenerContainer container) {
    if (!SeekUtils.doSeeks(records, consumer, thrownException, true, this.failureTracker::skip, logger)) {
        throw new KafkaException("Seek to current after exception", thrownException);
    }/*from w w  w  . ja  v a  2s . c om*/
}