Show / Hide Table of Contents

    Class KafkaOffset

    Represents the position of the message in a partition.

    Inheritance
    object
    KafkaOffset
    Implements
    IBrokerMessageOffset
    IBrokerMessageIdentifier
    IEquatable<IBrokerMessageIdentifier>
    IComparable<IBrokerMessageOffset>
    Inherited Members
    object.Equals(object, object)
    object.GetType()
    object.ReferenceEquals(object, object)
    object.ToString()
    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 source

    KafkaOffset(TopicPartitionOffset)

    Initializes a new instance of the KafkaOffset class.

    Declaration
    public KafkaOffset(TopicPartitionOffset topicPartitionOffset)
    Parameters
    Type Name Description
    TopicPartitionOffset topicPartitionOffset

    The Confluent.Kafka.TopicPartitionOffset.

    | Improve this doc View source

    KafkaOffset(string, int, long)

    Initializes a new instance of the KafkaOffset class.

    Declaration
    public KafkaOffset(string topic, int partition, long offset)
    Parameters
    Type Name Description
    string topic

    The name of the topic.

    int partition

    The partition number.

    long offset

    The offset in the partition.

    | Improve this doc View source

    KafkaOffset(string, string)

    Initializes a new instance of the KafkaOffset class.

    Declaration
    public KafkaOffset(string key, string value)
    Parameters
    Type Name Description
    string key

    The unique key of the queue, topic or partition the message was produced to or consumed from.

    string value

    The identifier value.

    Properties

    | Improve this doc View source

    Key

    Gets the unique key of the queue, topic or partition the message was produced to or consumed from.

    Declaration
    public string Key { get; }
    Property Value
    Type Description
    string
    | Improve this doc View source

    Offset

    Gets the offset in the partition.

    Declaration
    public long Offset { get; }
    Property Value
    Type Description
    long
    | Improve this doc View source

    Partition

    Gets the partition number.

    Declaration
    public int Partition { get; }
    Property Value
    Type Description
    int
    | Improve this doc View source

    Topic

    Gets the name of the topic.

    Declaration
    public string Topic { get; }
    Property Value
    Type Description
    string
    | Improve this doc View source

    Value

    Gets the identifier value.

    Declaration
    public string Value { get; }
    Property Value
    Type Description
    string

    Methods

    | Improve this doc View source

    CompareTo(IBrokerMessageOffset?)

    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(IBrokerMessageOffset? other)
    Parameters
    Type Name Description
    IBrokerMessageOffset other

    An object to compare with this instance.

    Returns
    Type Description
    int

    A value that indicates the relative order of the objects being compared. The return value has these meanings:
    Value

    Meaning

    Less than zero

    This instance precedes other in the sort order.

    Zero

    This instance occurs in the same position in the sort order as other.

    Greater than zero

    This instance follows other in the sort order.

    | Improve this doc View source

    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
    int

    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.

    | Improve this doc View source

    Equals(IBrokerMessageIdentifier?)

    Indicates whether the current object is equal to another object of the same type.

    Declaration
    public bool Equals(IBrokerMessageIdentifier? other)
    Parameters
    Type Name Description
    IBrokerMessageIdentifier other

    An object to compare with this object.

    Returns
    Type Description
    bool

    true if the current object is equal to the other parameter; otherwise, false.

    | Improve this doc View source

    Equals(object?)

    Determines whether the specified object is equal to the current object.

    Declaration
    public override bool Equals(object? obj)
    Parameters
    Type Name Description
    object obj

    The object to compare with the current object.

    Returns
    Type Description
    bool

    true if the specified object is equal to the current object; otherwise, false.

    Overrides
    object.Equals(object)
    | Improve this doc View source

    GetHashCode()

    Serves as the default hash function.

    Declaration
    public override int GetHashCode()
    Returns
    Type Description
    int

    A hash code for the current object.

    Overrides
    object.GetHashCode()
    | Improve this doc View source

    ToLogString()

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

    Declaration
    public string ToLogString()
    Returns
    Type Description
    string

    A string representing the offset value.

    Remarks

    This string should contain all identifiers except the endpoint name.

    | Improve this doc View source

    ToVerboseLogString()

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

    Declaration
    public string ToVerboseLogString()
    Returns
    Type Description
    string

    A string representing the offset value.

    Remarks

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

    Operators

    | Improve this doc View source

    operator ==(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
    bool
    | Improve this doc View source

    operator >(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
    bool
    | Improve this doc View source

    operator >=(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
    bool
    | Improve this doc View source

    operator !=(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
    bool
    | Improve this doc View source

    operator <(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
    bool
    | Improve this doc View source

    operator <=(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
    bool

    Implements

    IBrokerMessageOffset
    IBrokerMessageIdentifier
    IEquatable<T>
    IComparable<T>
    • Improve this doc
    • View source
    GitHub E-Mail
    ↑ Back to top © 2020 Sergio Aquilini