Class HashCodeNoEnvelopeMessageExtractor<M>
java.lang.Object
org.apache.pekko.cluster.sharding.typed.ShardingMessageExtractor<M,M>
org.apache.pekko.cluster.sharding.typed.HashCodeNoEnvelopeMessageExtractor<M>
- Type Parameters:
M- The type of message accepted by the entity actor
Default message extractor type, using a property of the message to identify what entity a message is for
and the hashcode of the entityId to decide which shard an entity belongs to.
This is recommended since it does not force details about sharding into the entity protocol
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionintThe shard identifier for a given entity id.toString()final MunwrapMessage(M message) Extract the message to send to the entity from an incomingmessage.Methods inherited from class org.apache.pekko.cluster.sharding.typed.ShardingMessageExtractor
apply, entityId, noEnvelope
-
Constructor Details
-
HashCodeNoEnvelopeMessageExtractor
public HashCodeNoEnvelopeMessageExtractor(int numberOfShards)
-
-
Method Details
-
numberOfShards
public int numberOfShards() -
shardId
Description copied from class:ShardingMessageExtractorThe shard identifier for a given entity id. Only messages that passed theShardingMessageExtractor.entityId(E)function will be used as input to this function.- Specified by:
shardIdin classShardingMessageExtractor<M,M>
-
toString
-
unwrapMessage
Description copied from class:ShardingMessageExtractorExtract the message to send to the entity from an incomingmessage. 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.- Specified by:
unwrapMessagein classShardingMessageExtractor<M,M>
-