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.
Implements
Inherited Members
Namespace: Akka.Cluster.Sharding
Assembly: Akka.Cluster.Sharding.dll
Syntax
public abstract class HashCodeMessageExtractor : IMessageExtractor
Constructors
| Improve this Doc View SourceHashCodeMessageExtractor(Int32)
TBD
Declaration
protected HashCodeMessageExtractor(int maxNumberOfShards)
Parameters
Type | Name | Description |
---|---|---|
Int32 | maxNumberOfShards | TBD |
Fields
| Improve this Doc View SourceMaxNumberOfShards
TBD
Declaration
public readonly int MaxNumberOfShards
Field Value
Type | Description |
---|---|
Int32 |
Methods
| Improve this Doc View SourceCreate(Int32, 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 |
---|---|---|
Int32 | maxNumberOfShards | |
Func<Object, String> | entityIdExtractor | |
Func<Object, Object> | messageExtractor |
Returns
Type | Description |
---|---|
HashCodeMessageExtractor |
EntityId(Object)
TBD
Declaration
public abstract string EntityId(object message)
Parameters
Type | Name | Description |
---|---|---|
Object | message | TBD |
Returns
Type | Description |
---|---|
String | TBD |
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 |
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 |
ShardId(String, Object)
Declaration
public virtual string ShardId(string entityId, object messageHint = null)
Parameters
Type | Name | Description |
---|---|---|
String | entityId | |
Object | messageHint |
Returns
Type | Description |
---|---|
String |