I did not found the github project for the docs to make a pull request. Sorry!
https://docs.spring.io/spring-kafka/docs/2.2.0.RELEASE/reference/html/_reference.html#seek-to-current
According to the docs, I should write
@Bean
public ConcurrentKafkaListenerContainerFactory<String, String> kafkaListenerContainerFactory() {
ConcurrentKafkaListenerContainerFactory<String, String> factory = new ConcurrentKafkaListenerContainerFactory();
factory.setConsumerFactory(consumerFactory());
factory.getContainerProperties().setAckOnError(false);
factory.getContainerProperties().setErrorHandler(new SeekToCurrentErrorHandler());
factory.getContainerProperties().setAckMode(AckMode.RECORD);
return factory;
}
but only
factory.setErrorHandler(new SeekToCurrentErrorHandler());
is usable.
The usage of
factory.getContainerProperties().setErrorHandler(new SeekToCurrentErrorHandler());
creates a "Cannot resolve method" exception.