I have an application that listens to a Kafka topic and reads 1 message from it in 1 thread. After reading a message, there is a certain logic, during which there are two options - everything is successful and a commit occurs call method ...acknowledge() to offset the offset and move on to the next message, or everything is unsuccessful and this message must be read again and the offset is not committed (...acknowledge() is not called)
If I do not call Acknowledge (), then shouldn't the consumer go on all reports in the topic and then go to the second circle, re-read the messages on which Acknowledge () was not called? Or how can I configure it?
I'm using spring-kafka and the following settings are specified:
spring.kafka.consumer.enable-auto-commit=falsespring.kafka.consumer.auto-offset-reset=earliestspring.kafka.consumer.max-poll-records=1
And I programmatically set the settings:
...setGroupId("test");...setSyncCommits(true);...setAckMode(ContainerProperties.AckMode.MANUAL_IMMEDIATE);...setConcurrency(1);