Class KafkaOffset
Represents the position of the message in a partition.
Inheritance
Inherited Members
Namespace: Silverback.Messaging.Broker
Assembly: Silverback.Integration.Kafka.dll
Syntax
public sealed class KafkaOffset : IBrokerMessageOffset, IBrokerMessageIdentifier, IEquatable<IBrokerMessageIdentifier>, IComparable<IBrokerMessageOffset>
Constructors
| Improve this doc View sourceKafkaOffset(TopicPartitionOffset)
Initializes a new instance of the KafkaOffset class.
Declaration
public KafkaOffset(TopicPartitionOffset topicPartitionOffset)
Parameters
Type | Name | Description |
---|---|---|
Confluent.Kafka.TopicPartitionOffset | topicPartitionOffset | The Confluent.Kafka.TopicPartitionOffset. |
KafkaOffset(String, Int32, Int64)
Initializes a new instance of the KafkaOffset class.
Declaration
public KafkaOffset(string topic, int partition, long offset)
Parameters
Type | Name | Description |
---|---|---|
System.String | topic | The name of the topic. |
System.Int32 | partition | The partition number. |
System.Int64 | offset | The offset in the partition. |
KafkaOffset(String, String)
Initializes a new instance of the KafkaOffset class.
Declaration
public KafkaOffset(string key, string value)
Parameters
Type | Name | Description |
---|---|---|
System.String | key | The unique key of the queue, topic or partition the message was produced to or consumed from. |
System.String | value | The identifier value. |
Properties
| Improve this doc View sourceKey
Declaration
public string Key { get; }
Property Value
Type | Description |
---|---|
System.String |
Offset
Gets the offset in the partition.
Declaration
public long Offset { get; }
Property Value
Type | Description |
---|---|
System.Int64 |
Partition
Gets the partition number.
Declaration
public int Partition { get; }
Property Value
Type | Description |
---|---|
System.Int32 |
Topic
Gets the name of the topic.
Declaration
public string Topic { get; }
Property Value
Type | Description |
---|---|
System.String |
Value
Declaration
public string Value { get; }
Property Value
Type | Description |
---|---|
System.String |
Methods
| Improve this doc View sourceCompareTo(IBrokerMessageOffset)
Declaration
public int CompareTo(IBrokerMessageOffset other)
Parameters
Type | Name | Description |
---|---|---|
IBrokerMessageOffset | other |
Returns
Type | Description |
---|---|
System.Int32 |
CompareTo(KafkaOffset)
Compares the current instance with another object of the same type and returns an integer that indicates whether the current instance precedes, follows, or occurs in the same position in the sort order as the other object.
Declaration
public int CompareTo(KafkaOffset other)
Parameters
Type | Name | Description |
---|---|---|
KafkaOffset | other | An object to compare with the current instance. |
Returns
Type | Description |
---|---|
System.Int32 | A value less than zero if this is less than object, zero if this is equal to object, or a value greater than zero if this is greater than object. |
Equals(IBrokerMessageIdentifier)
Declaration
public bool Equals(IBrokerMessageIdentifier other)
Parameters
Type | Name | Description |
---|---|---|
IBrokerMessageIdentifier | other |
Returns
Type | Description |
---|---|
System.Boolean |
Equals(Object)
Declaration
public override bool Equals(object obj)
Parameters
Type | Name | Description |
---|---|---|
System.Object | obj |
Returns
Type | Description |
---|---|
System.Boolean |
Overrides
GetHashCode()
Declaration
public override int GetHashCode()
Returns
Type | Description |
---|---|
System.Int32 |
Overrides
ToLogString()
Declaration
public string ToLogString()
Returns
Type | Description |
---|---|
System.String |
ToVerboseLogString()
Declaration
public string ToVerboseLogString()
Returns
Type | Description |
---|---|
System.String |
Operators
| Improve this doc View sourceEquality(KafkaOffset, KafkaOffset)
Equality operator.
Declaration
public static bool operator ==(KafkaOffset left, KafkaOffset right)
Parameters
Type | Name | Description |
---|---|---|
KafkaOffset | left | Left-hand operand. |
KafkaOffset | right | Right-hand operand. |
Returns
Type | Description |
---|---|
System.Boolean |
GreaterThan(KafkaOffset, KafkaOffset)
Greater than operator.
Declaration
public static bool operator>(KafkaOffset left, KafkaOffset right)
Parameters
Type | Name | Description |
---|---|---|
KafkaOffset | left | Left-hand operand. |
KafkaOffset | right | Right-hand operand. |
Returns
Type | Description |
---|---|
System.Boolean |
GreaterThanOrEqual(KafkaOffset, KafkaOffset)
Greater than or equal operator.
Declaration
public static bool operator >=(KafkaOffset left, KafkaOffset right)
Parameters
Type | Name | Description |
---|---|---|
KafkaOffset | left | Left-hand operand. |
KafkaOffset | right | Right-hand operand. |
Returns
Type | Description |
---|---|
System.Boolean |
Inequality(KafkaOffset, KafkaOffset)
Inequality operator.
Declaration
public static bool operator !=(KafkaOffset left, KafkaOffset right)
Parameters
Type | Name | Description |
---|---|---|
KafkaOffset | left | Left-hand operand. |
KafkaOffset | right | Right-hand operand. |
Returns
Type | Description |
---|---|
System.Boolean |
LessThan(KafkaOffset, KafkaOffset)
Less than operator.
Declaration
public static bool operator <(KafkaOffset left, KafkaOffset right)
Parameters
Type | Name | Description |
---|---|---|
KafkaOffset | left | Left-hand operand. |
KafkaOffset | right | Right-hand operand. |
Returns
Type | Description |
---|---|
System.Boolean |
LessThanOrEqual(KafkaOffset, KafkaOffset)
Less than or equal operator.
Declaration
public static bool operator <=(KafkaOffset left, KafkaOffset right)
Parameters
Type | Name | Description |
---|---|---|
KafkaOffset | left | Left-hand operand. |
KafkaOffset | right | Right-hand operand. |
Returns
Type | Description |
---|---|
System.Boolean |