Table of Contents

Class KafkaOffset

Namespace
Silverback.Messaging.Broker
Assembly
Silverback.Integration.Kafka.dll

Represents the position of the message in a partition.

public sealed record KafkaOffset : IBrokerMessageIdentifier, IEquatable<IBrokerMessageIdentifier>, IComparable<KafkaOffset>, IComparable, IEquatable<KafkaOffset>
Inheritance
KafkaOffset
Implements
Inherited Members

Constructors

KafkaOffset(TopicPartition, Offset)

Initializes a new instance of the KafkaOffset class.

public KafkaOffset(TopicPartition topicPartition, Offset offset)

Parameters

topicPartition TopicPartition

The Confluent.Kafka.TopicPartition.

offset Offset

The offset in the partition.

KafkaOffset(TopicPartitionOffset)

Initializes a new instance of the KafkaOffset class.

public KafkaOffset(TopicPartitionOffset topicPartitionOffset)

Parameters

topicPartitionOffset TopicPartitionOffset

The Confluent.Kafka.TopicPartitionOffset.

KafkaOffset(string, int, long)

Initializes a new instance of the KafkaOffset class.

public KafkaOffset(string topic, int partition, long offset)

Parameters

topic string

The topic.

partition int

The partition.

offset long

The offset in the partition.

Properties

IsSpecial

Gets a value indicating whether the offset is one of the special values (i.e. Confluent.Kafka.Offset.Unset, Confluent.Kafka.Offset.Beginning, Confluent.Kafka.Offset.End).

public bool IsSpecial { get; }

Property Value

bool

Offset

Gets the offset in the partition.

public Offset Offset { get; }

Property Value

Offset

TopicPartition

Gets the topic and partition.

public TopicPartition TopicPartition { get; }

Property Value

TopicPartition

Methods

CompareTo(KafkaOffset?)

public int CompareTo(KafkaOffset? other)

Parameters

other KafkaOffset

Returns

int

CompareTo(object?)

public int CompareTo(object? obj)

Parameters

obj object

Returns

int

Equals(IBrokerMessageIdentifier?)

public bool Equals(IBrokerMessageIdentifier? other)

Parameters

other IBrokerMessageIdentifier

Returns

bool

Equals(KafkaOffset?)

public bool Equals(KafkaOffset? other)

Parameters

other KafkaOffset

Returns

bool

Equals(object?)

public override bool Equals(object? obj)

Parameters

obj object

Returns

bool

GetHashCode()

public override int GetHashCode()

Returns

int

ToLogString()

Gets a string that can be used to log the identifier/offset value.

public string ToLogString()

Returns

string

A string representing the identifier/offset value.

Remarks

This string should contain all identifiers except the endpoint name.

ToString()

public override string ToString()

Returns

string

ToVerboseLogString()

Gets a string that can be used to log the identifier/offset value.

public string ToVerboseLogString()

Returns

string

A string representing the identifier/offset value.

Remarks

This string must include the endpoint name, if the identifier value isn't unique across different endpoints.

Operators

operator ==(KafkaOffset?, KafkaOffset?)

public static bool operator ==(KafkaOffset? left, KafkaOffset? right)

Parameters

left KafkaOffset
right KafkaOffset

Returns

bool

operator >(KafkaOffset, KafkaOffset)

Greater than operator.

public static bool operator >(KafkaOffset left, KafkaOffset right)

Parameters

left KafkaOffset

Left-hand operand.

right KafkaOffset

Right-hand operand.

Returns

bool

operator >=(KafkaOffset, KafkaOffset)

Greater than or equal operator.

public static bool operator >=(KafkaOffset left, KafkaOffset right)

Parameters

left KafkaOffset

Left-hand operand.

right KafkaOffset

Right-hand operand.

Returns

bool

operator !=(KafkaOffset?, KafkaOffset?)

public static bool operator !=(KafkaOffset? left, KafkaOffset? right)

Parameters

left KafkaOffset
right KafkaOffset

Returns

bool

operator <(KafkaOffset, KafkaOffset)

Less than operator.

public static bool operator <(KafkaOffset left, KafkaOffset right)

Parameters

left KafkaOffset

Left-hand operand.

right KafkaOffset

Right-hand operand.

Returns

bool

operator <=(KafkaOffset, KafkaOffset)

Less than or equal operator.

public static bool operator <=(KafkaOffset left, KafkaOffset right)

Parameters

left KafkaOffset

Left-hand operand.

right KafkaOffset

Right-hand operand.

Returns

bool