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
| Improve this Doc View SourceEntityId(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 |
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 |
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. |
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. |