11

What is the difference between Kafka Acknowledgment and Kafka consumer commitSync ()

Both are used for purpose of manual offset management, and hope both works Synchronously.

Please assist

c0der512
  • 546
  • 5
  • 18
Arpit Saklecha
  • 123
  • 1
  • 7

1 Answers1

19

When using spring-kafka, the Acknowledgment is an abstraction over the detailed consumer API for committing offsets.

When you call acknowledgement.acknowledge(); the action depends on configuration. With AckMode.MANUAL, the commit is queued for the consumer to process later; with MANUAL_IMMEDIATE, commitSync() (default, or async, depending on configuration) is called immediately.

Gary Russell
  • 166,535
  • 14
  • 146
  • 179
  • 1
    Thanks Gary for quick response, got it so MANUAL_IMMEDIATE and commitSync does the same stuff..Acknowledgment is a more of a spring way to manage offsets – Arpit Saklecha Jan 22 '20 at 18:08