CommittableOffsetBatch represents a batch of Kafka offsets which can be committed together using commit. An offset, or one more batch, can be added an existing batch using updated. Note that this requires the offsets per topic-partition to be included in-order, since offset commits in general require it.
If you have some offsets in-order per topic-partition, you can fold them together using CommittableOffsetBatch#empty and updated, or you can use CommittableOffsetBatch#fromFoldable. Generally, prefer to use fromFoldable, as it has better performance. Provided pipes like commitBatchWithin are also to be preferred, as they also achieve better performance.
If one of the conditions above do not hold, there will be a ConsumerGroupException exception raised and a commit will not be attempted. If offsets is empty then these conditions do not need to hold, as there is nothing to commit.
The consumer group IDs for the offsets in the batch.
The consumer group IDs for the offsets in the batch. For the batch to be valid and for commit to succeed, there should be exactly one ID in the set and the flag consumerGroupIdsMissing should be false.
There might be more than one consumer group ID in the set if offsets from multiple consumers, with different group IDs, have accidentally been mixed. The set might also be empty if no consumer group IDs have been specified.
true if any offset in the batch came from a consumer without a group ID; false otherwise.
true if any offset in the batch came from a consumer without a group ID; false otherwise. For the batch to be valid and for commit to succeed, this flag must be false and there should be exactly one consumer group ID in consumerGroupIds.
Creates a new CommittableOffsetBatch with the specified offset included. Note that this function requires offsets to be in-order per topic-partition, as provided offsets will override existing offsets for the same topic-partition.
Creates a new CommittableOffsetBatch with the specified offsets included. Note that this function requires offsets to be in-order per topic-partition, as provided offsets will override existing offsets for the same topic-partition.