KafkaCommit

trait KafkaCommit[F <: ([_$1] =>> Any)]
class Object
trait Matchable
class Any
class KafkaConsumer[F, K, V]

Value members

Methods

def commitAsync(offsets: Map[TopicPartition, OffsetAndMetadata]): F[Unit]
Commit the specified offsets for the specified list of topics and partitions to Kafka.

This commits offsets to Kafka. The offsets committed using this API will be used on the first fetch after every
rebalance and also on startup. As such, if you need to store offsets in anything other than Kafka, this API
should not be used. The committed offset should be the next message your application will consume,
i.e. lastProcessedMessageOffset + 1. If automatic group management with subscribe is used,
then the committed offsets must belong to the currently auto-assigned partitions.

Offsets committed through multiple calls to this API are guaranteed to be sent in the same order as
the invocations. Additionally note that
offsets committed through this API are guaranteed to complete before a subsequent call to commitSync
(and variants) returns.

Note, that the recommended way for committing offsets in fs2-kafka is to use commit on
CommittableConsumerRecord, CommittableOffset or CommittableOffsetBatch.
commitAsync and commitSync usually needs only for some custom scenarios.
Value Params
offsets
A map of offsets by partition with associate metadata.
See also
org.apache.kafka.clients.consumer.KafkaConsumer#commitAsync
def commitSync(offsets: Map[TopicPartition, OffsetAndMetadata]): F[Unit]
Commit the specified offsets for the specified list of topics and partitions.

This commits offsets to Kafka. The offsets committed using this API will be used on the first fetch after every
rebalance and also on startup. As such, if you need to store offsets in anything other than Kafka, this API
should not be used. The committed offset should be the next message your application will consume,
i.e. lastProcessedMessageOffset + 1. If automatic group management with subscribe is used,
then the committed offsets must belong to the currently auto-assigned partitions.

Despite of it's name, this method is not blocking. But it's based on a blocking
org.apache.kafka.clients.consumer.KafkaConsumer#commitSync method.

Note, that the recommended way for committing offsets in fs2-kafka is to use commit on
CommittableConsumerRecord, CommittableOffset or CommittableOffsetBatch.
commitAsync and commitSync usually needs only for some custom scenarios.
Value Params
offsets
A map of offsets by partition with associated metadata
See also
org.apache.kafka.clients.consumer.KafkaConsumer#commitSync