Search Results for

    Show / Hide Table of Contents

    Class HashCodeMessageExtractor

    Convenience implementation of IMessageExtractor that construct ShardId based on the StringHash(string) of the EntityId. The number of unique shards is limited by the given MaxNumberOfShards.

    Inheritance
    object
    HashCodeMessageExtractor
    Implements
    IMessageExtractor
    Inherited Members
    object.Equals(object)
    object.Equals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    object.ReferenceEquals(object, object)
    object.ToString()
    Namespace: Akka.Cluster.Sharding
    Assembly: Akka.Cluster.Sharding.dll
    Syntax
    public abstract class HashCodeMessageExtractor : IMessageExtractor

    Constructors

    | Edit this page View Source

    HashCodeMessageExtractor(int)

    TBD

    Declaration
    protected HashCodeMessageExtractor(int maxNumberOfShards)
    Parameters
    Type Name Description
    int maxNumberOfShards

    TBD

    Fields

    | Edit this page View Source

    MaxNumberOfShards

    TBD

    Declaration
    public readonly int MaxNumberOfShards
    Field Value
    Type Description
    int

    Methods

    | Edit this page View Source

    Create(int, Func<object, string?>, Func<object, object>?)

    creates a instance of the HashCodeMessageExtractor with the given handlers

    Declaration
    public static HashCodeMessageExtractor Create(int maxNumberOfShards, Func<object, string?> entityIdExtractor, Func<object, object>? messageExtractor = null)
    Parameters
    Type Name Description
    int maxNumberOfShards
    Func<object, string> entityIdExtractor
    Func<object, object> messageExtractor
    Returns
    Type Description
    HashCodeMessageExtractor
    | Edit this page View Source

    EntityId(object)

    TBD

    Declaration
    public abstract string? EntityId(object message)
    Parameters
    Type Name Description
    object message

    TBD

    Returns
    Type Description
    string

    TBD

    | Edit this page View Source

    EntityMessage(object)

    Default implementation pass on the message as is.

    Declaration
    public virtual object? EntityMessage(object message)
    Parameters
    Type Name Description
    object message

    TBD

    Returns
    Type Description
    object

    TBD

    | Edit this page View Source

    ShardId(object)

    TBD

    Declaration
    [Obsolete("Use ShardId(string, object?) instead. Since v1.5.15")]
    public virtual string? ShardId(object message)
    Parameters
    Type Name Description
    object message

    TBD

    Returns
    Type Description
    string

    TBD

    | Edit this page View Source

    ShardId(string, object?)

    More performant overload of EntityId(object) that accepts an entity id in order to allow faster method chaining and comparisons inside Akka.NET.

    Declaration
    public virtual string ShardId(string entityId, object? messageHint = null)
    Parameters
    Type Name Description
    string entityId

    Should always be populated with a non-null value.

    object messageHint

    The message - FOR BACKWARDS COMPATIBILITY ONLY.

    Returns
    Type Description
    string

    The ShardId.

    Implements

    IMessageExtractor

    Extension Methods

    ObjectExtensions.IsDefaultForType<T>(T)
    ObjectExtensions.AsOption<T>(T)
    Extensions.AsInstanceOf<T>(object)
    In this article
    • githubEdit this page
    • View Source
    Back to top
    Contribute
    • Project Chat
    • Discussion Forum
    • Source Code
    Support
    • Akka.NET Support Plans
    • Akka.NET Observability Tools
    • Akka.NET Training & Consulting
    Maintained By
    • Petabridge - The Akka.NET Company
    • Learn Akka.NET