1
votes

I want to use Spring Kafka to process events into a local database and store the offset in the database itself, as described in https://kafka.apache.org/25/javadoc/index.html?org/apache/kafka/clients/consumer/KafkaConsumer.html under "Storing Offsets Outside Kafka".

Spring Kafka (with a KafkaListener) seems to always commit offsets though (and thus requires a group.id), is there a way to disable commits altogether allowing to listen without a group?

2

2 Answers

0
votes

Spring Kafka Consumer has a configuration property enable.auto.commit. This can be set to false so that you can implement a commit strategy in your code. Please see the documentation here: https://docs.spring.io/spring-kafka/reference/html/#committing-offsets

The KafkaListener annotation can have configuration defined directly. Please see the JavaDoc - https://docs.spring.io/spring-kafka/api/org/springframework/kafka/annotation/KafkaListener.html.

0
votes

Container property AckMode.MANUAL will disable offset commits by the container.