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
topicPartitionTopicPartitionThe Confluent.Kafka.TopicPartition.
offsetOffsetThe offset in the partition.
KafkaOffset(TopicPartitionOffset)
Initializes a new instance of the KafkaOffset class.
public KafkaOffset(TopicPartitionOffset topicPartitionOffset)
Parameters
topicPartitionOffsetTopicPartitionOffsetThe Confluent.Kafka.TopicPartitionOffset.
KafkaOffset(string, int, long)
Initializes a new instance of the KafkaOffset class.
public KafkaOffset(string topic, int partition, long offset)
Parameters
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
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
otherKafkaOffset
Returns
CompareTo(object?)
public int CompareTo(object? obj)
Parameters
objobject
Returns
Equals(IBrokerMessageIdentifier?)
public bool Equals(IBrokerMessageIdentifier? other)
Parameters
otherIBrokerMessageIdentifier
Returns
Equals(KafkaOffset?)
public bool Equals(KafkaOffset? other)
Parameters
otherKafkaOffset
Returns
Equals(object?)
public override bool Equals(object? obj)
Parameters
objobject
Returns
GetHashCode()
public override int GetHashCode()
Returns
ToLogString()
Gets a string that can be used to log the identifier/offset value.
public string ToLogString()
Returns
Remarks
This string should contain all identifiers except the endpoint name.
ToString()
public override string ToString()
Returns
ToVerboseLogString()
Gets a string that can be used to log the identifier/offset value.
public string ToVerboseLogString()
Returns
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
leftKafkaOffsetrightKafkaOffset
Returns
operator >(KafkaOffset, KafkaOffset)
Greater than operator.
public static bool operator >(KafkaOffset left, KafkaOffset right)
Parameters
leftKafkaOffsetLeft-hand operand.
rightKafkaOffsetRight-hand operand.
Returns
operator >=(KafkaOffset, KafkaOffset)
Greater than or equal operator.
public static bool operator >=(KafkaOffset left, KafkaOffset right)
Parameters
leftKafkaOffsetLeft-hand operand.
rightKafkaOffsetRight-hand operand.
Returns
operator !=(KafkaOffset?, KafkaOffset?)
public static bool operator !=(KafkaOffset? left, KafkaOffset? right)
Parameters
leftKafkaOffsetrightKafkaOffset
Returns
operator <(KafkaOffset, KafkaOffset)
Less than operator.
public static bool operator <(KafkaOffset left, KafkaOffset right)
Parameters
leftKafkaOffsetLeft-hand operand.
rightKafkaOffsetRight-hand operand.
Returns
operator <=(KafkaOffset, KafkaOffset)
Less than or equal operator.
public static bool operator <=(KafkaOffset left, KafkaOffset right)
Parameters
leftKafkaOffsetLeft-hand operand.
rightKafkaOffsetRight-hand operand.