Class ShardingConsumerController
ShardingConsumerController is used together with ShardingProducerController.
ShardingConsumerController is the entity actor that is initialized via ClusterSharding. It will manage the lifecycle and message delivery to the destination consumer actor (your actor type specified via Props in the Create<T>(Func<IActorRef, Props>, ShardingConsumerController.Settings) method.)
The destination consumer actor will start the flow by sending an initial ConsumerController.Start<T> message to the ShardingConsumerController, its parent actor.
Received messages from the producer are wrapped in a ConsumerController.Delivery<T> message and sent to the destination consumer actor, which is supposed to reply with ConsumerController.Confirmed when it has successfully processed the message.
Next message from the producer will not be delivered until the destination consumer actor has confirmed the previous message. However, since there can be several producers, e.g. one per node, sending messages to the same destination entity actor there can be multiple ConsumerController.Delivery<T> messages in flight at the same time.
More messages from a specific producer that arrive while waiting for the confirmation are stashed by the ConsumerController and delivered when the previous messages are confirmed.
Inherited Members
Namespace: Akka.Cluster.Sharding.Delivery
Assembly: Akka.Cluster.Sharding.dll
Syntax
public static class ShardingConsumerController
Methods
| Improve this Doc View SourceCreate<T>(Func<IActorRef, Props>, ShardingConsumerController.Settings)
Creates a new instance of ShardingConsumerController props for the given entity and type of message.
Declaration
public static Props Create<T>(Func<IActorRef, Props> consumerProps, ShardingConsumerController.Settings settings)
Parameters
Type | Name | Description |
---|---|---|
Func<IActorRef, Props> | consumerProps | A function that passes in the ShardingConsumerController actor reference in exchange for the consumer's Props. |
ShardingConsumerController.Settings | settings | The settings for the ShardingConsumerController. |
Returns
Type | Description |
---|---|
Props | The props used to start this entity. |
Type Parameters
Name | Description |
---|---|
T | The type of message for which we will be guaranteeing delivery. |