Reputation: 61
I have a topic with 2 partitions. I am using kafka batch listener mode in my consumer application. Since, I am using a single consumer application therefore I will receive messages from both partitions. Once the consumer application process those list of messages, I want to commit the largest offset of each partition manually.
If I use MANUAL_IMMEDIATE mode, will it commit the highest offset of each partition? If not what is the approach I should use?
Upvotes: 4
Views: 2116
Reputation: 174634
Yes; acknowledgment.ack()
will commit the offset of the highest offset of all partitions for which records were received.
However, the container will do it automatically for you if you use the default AckMode.BATCH
. This is simpler than dealing with manual acks.
Upvotes: 3