c

akka.cluster.sharding.typed

ShardingEnvelope

final case class ShardingEnvelope[M](entityId: String, message: M) extends WrappedMessage with ClusterShardingTypedSerializable with Product with 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.

entityId

The business domain identifier of the entity.

message

The message to be send to the entity.

Source
ShardingMessageExtractor.scala
Exceptions thrown

`InvalidMessageException` if message is null.

Linear Supertypes
Serializable, Product, Equals, ClusterShardingTypedSerializable, WrappedMessage, AnyRef, Any
Type Hierarchy
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. ShardingEnvelope
  2. Serializable
  3. Product
  4. Equals
  5. ClusterShardingTypedSerializable
  6. WrappedMessage
  7. AnyRef
  8. Any
Implicitly
  1. by any2stringadd
  2. by StringFormat
  3. by Ensuring
  4. by ArrowAssoc
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. Protected

Instance Constructors

  1. new ShardingEnvelope(entityId: String, message: M)

    entityId

    The business domain identifier of the entity.

    message

    The message to be send to the entity.

    Exceptions thrown

    `InvalidMessageException` if message is null.

Value Members

  1. val entityId: String
  2. val message: M
    Definition Classes
    WrappedMessage
  3. def productElementNames: Iterator[String]
    Definition Classes
    Product