Raj
Raj

Reputation: 1727

What's the basic difference between single record kafka consumer and kafka batch consumer?

I am using spring-kafka 2.2.8 and trying to understand what's the main difference between single record consumer and a batch consumer.

As far as I understand, reading messages/bytes from a topic wouldn't be any different for a single record consumer vs batch consumer. The only difference is how the offset is committed. And hence error handling. Is my understanding correct? Please confirm.

Upvotes: 0

Views: 1377

Answers (1)

Gary Russell
Gary Russell

Reputation: 174604

With a record-based listener, the records returned by the poll are handed to the listener one at a time. The container can be configured to commit the offsets one-at-a-time, or after all records are processed (default).

With a batch listener, the records returned by the poll are all handed to the listener in one call.

Upvotes: 1

Related Questions