Reputation: 2177
How is a client.id used by a producer? My understanding was that a kafka consumer needs client.id in order to associate it with offsets. For example an application could be using the "abc123" client.id to read from a topic and if it fails, it can be restarted with that same client.id and continue reading from where it left off.
On the other hand my understanding was that producers always write to the end of the topic. So, why would a kafka producer need a client.id?
Upvotes: 4
Views: 6700
Reputation: 26885
I think you are confusing client.id
and group.id
.
The group.id
setting is used by consumers to indicate the group they belong to and commit offsets so they can be restarted and continue where they left from.
On the other hand, client.id
is used to indicate the identity of clients. It can be used by all client types (Producer, Consumer, Admin, Connect and Streams). It's helpful to identify a specific instance in metrics or logs and can also be used to set quotas for example.
Upvotes: 10