Search Results for

    Show / Hide Table of Contents

    Interface IMessageExtractor

    Interface of functions to extract entity id, shard id, and the message to send to the entity from an incoming message.

    Namespace: Akka.Cluster.Sharding
    Assembly: Akka.Cluster.Sharding.dll
    Syntax
    public interface IMessageExtractor

    Methods

    | Edit this page View Source

    EntityId(object)

    Extract the entity id from an incoming message. If null is returned the message will be unhandled, i.e. posted as Unhandled messages on the event stream

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

    TBD

    Returns
    Type Description
    string

    TBD

    | Edit this page View Source

    EntityMessage(object)

    Extract the message to send to the entity from an incoming message. Note that the extracted message does not have to be the same as the incoming message to support wrapping in message envelope that is unwrapped before sending to the entity actor.

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

    TBD

    Returns
    Type Description
    object

    TBD

    | Edit this page View Source

    ShardId(object)

    Extract the shard id from an incoming message. Only messages that passed the EntityId(object) method will be used as input to this method.

    Declaration
    [Obsolete("Use ShardId(EntityId, object) instead.")]
    string? ShardId(object message)
    Parameters
    Type Name Description
    object message

    The message being delivered to the entity actor.

    Returns
    Type Description
    string

    The ShardId.

    | 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
    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.

    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