rayman
rayman

Reputation: 21616

does Kafka auto commit is sync or async under the hood?

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?

Upvotes: 2

Views: 1506

Answers (1)

Mickael Maison
Mickael Maison

Reputation: 26910

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.

Upvotes: 5

Related Questions