CommittableOffsetBatch

sealed abstract class CommittableOffsetBatch[F[_]]

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.

Use CommittableOffsetBatch#empty to create an empty batch. The CommittableOffset#batch function can be used to create a batch from an existing CommittableOffset.

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.

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.

Use CommittableOffsetBatch#empty to create an empty batch. The CommittableOffset#batch function can be used to create a batch from an existing CommittableOffset.

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.

Companion
object
class Object
trait Matchable
class Any

Value members

Abstract methods

def commit: F[Unit]

Commits the offsets to Kafka in a single commit. For the batch to be valid and for commit to succeed, the following conditions must hold:

Commits the offsets to Kafka in a single commit. For the batch to be valid and for commit to succeed, the following conditions must hold:


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.
def consumerGroupIds: Set[String]

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.

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. 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.

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.

def offsets: Map[TopicPartition, OffsetAndMetadata]

The offsets included in the CommittableOffsetBatch.

The offsets included in the CommittableOffsetBatch.

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 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.

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.