Class OffsetsTracker
Keeps track of the offsets of the messages being produced or consumed.
Inherited Members
Namespace: Silverback.Messaging.Broker.Kafka
Assembly: Silverback.Integration.Kafka.dll
Syntax
public sealed class OffsetsTracker
Methods
| Improve this doc View sourceCommit(TopicPartitionOffset)
Marks the specified offset as committed.
Declaration
public void Commit(TopicPartitionOffset offset)
Parameters
Type | Name | Description |
---|---|---|
TopicPartitionOffset | 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. |
UntrackAllPartitions()
Removes the tracked offset for all partitions.
Declaration
public void UntrackAllPartitions()
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. |