Skip to content

Documentation about using the SeekToCurrentErrorHandler in Spring Kafka 2.2 is wrong #862

@MartinX3

Description

@MartinX3

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.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions