Package akka.cluster.sharding.typed
Class ShardingEnvelope<M>
- java.lang.Object
-
- akka.cluster.sharding.typed.ShardingEnvelope<M>
-
- All Implemented Interfaces:
WrappedMessage
,ClusterShardingTypedSerializable
,java.io.Serializable
,scala.Equals
,scala.Product
public final class ShardingEnvelope<M> extends java.lang.Object implements WrappedMessage, ClusterShardingTypedSerializable, scala.Product, java.io.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:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description ShardingEnvelope(java.lang.String entityId, M message)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static <M> ShardingEnvelope<M>
apply(java.lang.String entityId, M message)
boolean
canEqual(java.lang.Object x$1)
<M> ShardingEnvelope<M>
copy(java.lang.String entityId, M message)
<M> java.lang.String
copy$default$1()
<M> M
copy$default$2()
java.lang.String
entityId()
boolean
equals(java.lang.Object x$1)
int
hashCode()
M
message()
int
productArity()
java.lang.Object
productElement(int x$1)
java.lang.String
productElementName(int x$1)
scala.collection.Iterator<java.lang.Object>
productIterator()
java.lang.String
productPrefix()
java.lang.String
toString()
static <M> scala.Option<scala.Tuple2<java.lang.String,M>>
unapply(ShardingEnvelope<M> x$0)
-
-
-
Constructor Detail
-
ShardingEnvelope
public ShardingEnvelope(java.lang.String entityId, M message)
-
-
Method Detail
-
apply
public static <M> ShardingEnvelope<M> apply(java.lang.String entityId, M message)
-
unapply
public static <M> scala.Option<scala.Tuple2<java.lang.String,M>> unapply(ShardingEnvelope<M> x$0)
-
entityId
public java.lang.String entityId()
-
message
public M message()
- Specified by:
message
in interfaceWrappedMessage
-
copy
public <M> ShardingEnvelope<M> copy(java.lang.String entityId, M message)
-
copy$default$1
public <M> java.lang.String copy$default$1()
-
copy$default$2
public <M> M copy$default$2()
-
productPrefix
public java.lang.String productPrefix()
- Specified by:
productPrefix
in interfacescala.Product
-
productArity
public int productArity()
- Specified by:
productArity
in interfacescala.Product
-
productElement
public java.lang.Object productElement(int x$1)
- Specified by:
productElement
in interfacescala.Product
-
productIterator
public scala.collection.Iterator<java.lang.Object> productIterator()
- Specified by:
productIterator
in interfacescala.Product
-
canEqual
public boolean canEqual(java.lang.Object x$1)
- Specified by:
canEqual
in interfacescala.Equals
-
productElementName
public java.lang.String productElementName(int x$1)
- Specified by:
productElementName
in interfacescala.Product
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
equals
public boolean equals(java.lang.Object x$1)
- Specified by:
equals
in interfacescala.Equals
- Overrides:
equals
in classjava.lang.Object
-
-