2

If kafka enable.auto.commit=true does it mean that every 5 seconds it will trigger under the hood the sync or async operation for committing the offset?

can small interval(2 seconds) somehow influence latency?

Mickael Maison
  • 25,067
  • 7
  • 71
  • 68
rayman
  • 20,786
  • 45
  • 148
  • 246
  • 1
    maybe these can help: https://stackoverflow.com/questions/46546489/how-does-kafka-consumer-auto-commit-work?rq=1 https://stackoverflow.com/questions/46546174/kafka-consumer-commitsync-vs-commitasync – salc2 Jan 23 '19 at 17:40

1 Answers1

4

It actually uses both!

The "regular" auto commit that happens periodically when calling poll() using async. See 1.

However, auto commit also happens when the consumer is closing or when joining a group and in these cases, it's using synchronous. See 2 or 3.

Regarding, auto commit using a low interval impacting latency, in most scenarios it's rather unlikely.

Mickael Maison
  • 25,067
  • 7
  • 71
  • 68