kafka-go
kafka-go copied to clipboard
Have optional metadata when doing a commit message
When using the CommitMessages for committing an offset, there is no way to specify any metadata for the client to keep. Even though the offsetCommitRequestV2Partition does contain a Metadata string, there doesn't seem to be a way to populate that Metadata when committing an offset.
The intent here is to allow clients to store relevant information about their state within a Offset commit, such that when a service does a recovery, it not only pick off where the last commit offset was, but also recovers any relevant clients data last stored.
See https://github.com/confluentinc/parallel-consumer#offset_map as a potential use case for allowing the client to specify its metadata associated to a Commit Offset.
Hi @nicolaspeters, passing Metadata through CommitMessages seems challenging since the function signature would have to change to support this. This sounds like a feature kafka-go should support- I think we could add a new function such as CommitMessagesWithMetadata that passes through the metadata associated with each offset.