Class ShardingEnvelope<M>
java.lang.Object
org.apache.pekko.cluster.sharding.typed.ShardingEnvelope<M>
- All Implemented Interfaces:
Serializable,WrappedMessage,scala.Equals,scala.Product
public final class ShardingEnvelope<M>
extends Object
implements WrappedMessage, scala.Product, Serializable
Default envelope type that may be used with Cluster Sharding.
Cluster Sharding provides a default HashCodeMessageExtractor that is able to handle
these types of messages, by hashing the entityId into into the shardId. It is not the only,
but a convenient way to send envelope-wrapped messages via cluster sharding.
The alternative way of routing messages through sharding is to not use envelopes, and have the message types themselves carry identifiers.
param: entityId The business domain identifier of the entity. param: message The message to be send to the entity.
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic <M> ShardingEnvelope<M>boolean<M> ShardingEnvelope<M><M> String<M> MentityId()booleaninthashCode()message()intproductElement(int x$1) productElementName(int x$1) scala.collection.Iterator<Object>toString()static <M> scala.Option<scala.Tuple2<String,M>> unapply(ShardingEnvelope<M> x$0) Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface scala.Product
productElementNames
-
Constructor Details
-
ShardingEnvelope
-
-
Method Details
-
apply
-
unapply
-
entityId
-
message
- Specified by:
messagein interfaceWrappedMessage
-
copy
-
copy$default$1
-
copy$default$2
public <M> M copy$default$2() -
productPrefix
- Specified by:
productPrefixin interfacescala.Product
-
productArity
public int productArity()- Specified by:
productArityin interfacescala.Product
-
productElement
- Specified by:
productElementin interfacescala.Product
-
productIterator
- Specified by:
productIteratorin interfacescala.Product
-
canEqual
- Specified by:
canEqualin interfacescala.Equals
-
productElementName
- Specified by:
productElementNamein interfacescala.Product
-
hashCode
public int hashCode() -
toString
-
equals
-