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
- Source:
- CommittableOffsetBatch.scala
Value members
Abstract methods
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:
- consumerGroupIdsMissing must be false, and
- consumerGroupIds must have exactly one ID.
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.
- Source:
- CommittableOffsetBatch.scala
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.
- Source:
- CommittableOffsetBatch.scala
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.
- Source:
- CommittableOffsetBatch.scala
The offsets included in the CommittableOffsetBatch.
The offsets included in the CommittableOffsetBatch.
- Source:
- CommittableOffsetBatch.scala
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.
- Source:
- CommittableOffsetBatch.scala
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.
- Source:
- CommittableOffsetBatch.scala