Class OffsetsTracker
Keeps track of the offsets of the messages being produced or consumed.
Implements
Inherited Members
Namespace: Silverback.Messaging.Broker.Kafka
Assembly: Silverback.Integration.Kafka.dll
Syntax
public sealed class OffsetsTracker : IBrokerMessageIdentifiersTracker
Constructors
OffsetsTracker()
Keeps track of the offsets of the messages being produced or consumed.
Declaration
public OffsetsTracker()
Methods
Commit(KafkaOffset)
Marks the specified offset as committed.
Declaration
public void Commit(KafkaOffset offset)
Parameters
| Type | Name | Description |
|---|---|---|
| KafkaOffset | offset | The offset to be marked as committed. |
GetCommitOffsets()
Gets the offsets to be used to commit after successful processing.
Declaration
public IReadOnlyCollection<KafkaOffset> GetCommitOffsets()
Returns
| Type | Description |
|---|---|
| IReadOnlyCollection<KafkaOffset> | The offsets to be used to commit. |
GetRollbackOffSets()
Gets the offsets to be used to rollback in case of error.
Declaration
public IReadOnlyCollection<KafkaOffset> GetRollbackOffSets()
Returns
| Type | Description |
|---|---|
| IReadOnlyCollection<KafkaOffset> | The offsets to be used to rollback. |
TrackOffset(TopicPartitionOffset)
Tracks the specified offset.
Declaration
public void TrackOffset(TopicPartitionOffset offset)
Parameters
| Type | Name | Description |
|---|---|---|
| TopicPartitionOffset | offset | The offset to be tracked. |
TrackOffset(KafkaOffset)
Tracks the specified offset.
Declaration
public void TrackOffset(KafkaOffset offset)
Parameters
| Type | Name | Description |
|---|---|---|
| KafkaOffset | offset | The offset to be tracked. |
UntrackPartition(TopicPartition)
Removes the tracked offset for the specified partition.
Declaration
public void UntrackPartition(TopicPartition topicPartition)
Parameters
| Type | Name | Description |
|---|---|---|
| TopicPartition | topicPartition | The partition to be untracked. |