Package akka.cluster.sharding.typed
Class SliceRangeShardAllocationStrategy.ShardBySliceMessageExtractor<M>
- java.lang.Object
-
- akka.cluster.sharding.typed.ShardingMessageExtractor<ShardingEnvelope<M>,M>
-
- akka.cluster.sharding.typed.SliceRangeShardAllocationStrategy.ShardBySliceMessageExtractor<M>
-
- Enclosing class:
- SliceRangeShardAllocationStrategy
public static final class SliceRangeShardAllocationStrategy.ShardBySliceMessageExtractor<M> extends ShardingMessageExtractor<ShardingEnvelope<M>,M>
To be used together withSliceRangeShardAllocationStrategy. The slice of the entity is used as shardId.
-
-
Constructor Summary
Constructors Constructor Description ShardBySliceMessageExtractor(java.lang.String entityType, Persistence persistence)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.StringentityId(ShardingEnvelope<M> envelope)Extract the entity id from an incomingmessage.java.lang.StringshardId(java.lang.String entityId)The shard identifier for a given entity id.MunwrapMessage(ShardingEnvelope<M> envelope)Extract the message to send to the entity from an incomingmessage.-
Methods inherited from class akka.cluster.sharding.typed.ShardingMessageExtractor
apply, noEnvelope
-
-
-
-
Constructor Detail
-
ShardBySliceMessageExtractor
public ShardBySliceMessageExtractor(java.lang.String entityType, Persistence persistence)
-
-
Method Detail
-
entityId
public java.lang.String entityId(ShardingEnvelope<M> envelope)
Description copied from class:ShardingMessageExtractorExtract the entity id from an incomingmessage. Ifnullis returned the message will beunhandled, i.e. posted asUnhandledmessages on the event stream- Specified by:
entityIdin classShardingMessageExtractor<ShardingEnvelope<M>,M>
-
shardId
public java.lang.String shardId(java.lang.String entityId)
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<ShardingEnvelope<M>,M>
-
unwrapMessage
public M unwrapMessage(ShardingEnvelope<M> envelope)
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<ShardingEnvelope<M>,M>
-
-