Table of Contents

Class KafkaOffsetStoreScope

Namespace
Silverback.Messaging.Consuming.KafkaOffsetStore
Assembly
Silverback.Integration.Kafka.dll

The scope of the client side offset store. A scope is created per each consume cycle and is used to atomically store the processed offsets.

public sealed class KafkaOffsetStoreScope
Inheritance
KafkaOffsetStoreScope
Inherited Members

Constructors

KafkaOffsetStoreScope(IKafkaOffsetStore, ConsumerPipelineContext)

Initializes a new instance of the KafkaOffsetStoreScope class.

public KafkaOffsetStoreScope(IKafkaOffsetStore offsetStore, ConsumerPipelineContext context)

Parameters

offsetStore IKafkaOffsetStore

The IKafkaOffsetStore.

context ConsumerPipelineContext

The ISilverbackContext.

Properties

SilverbackContext

public ISilverbackContext SilverbackContext { get; }

Property Value

ISilverbackContext

Methods

StoreOffsetsAsync()

Store all offsets that have been processed in this scope.

public Task StoreOffsetsAsync()

Returns

Task

A Task representing the asynchronous operation.

Remarks

Like the consumer commit, the offsets lower than the ones already committed (e.g., of an incomplete chunked message aborted after the next messages were committed) and the offsets of the partitions being rolled back (which may be rolled back to a preceding message) aren't stored. Unlike the consumer commit, the offsets are stored even if the partition was revoked while the message was being processed: the message was processed and the offsets are stored atomically with the changes done by the subscriber, so that it isn't processed again after the partition is assigned again.