Class ShardingDirectReplication$
- java.lang.Object
-
- akka.cluster.sharding.typed.ShardingDirectReplication$
-
public class ShardingDirectReplication$ extends java.lang.Object
INTERNAL APIUsed when sharding Replicated Event Sourced entities in multiple instances of sharding, for example one per DC in a Multi DC Akka Cluster.
This actor should be started once on each node where Replicated Event Sourced entities will run (the same nodes that you start sharding on). The entities should be set up with
akka.persistence.typed.scaladsl.EventSourcedBehavior.withEventPublishing
orReplicatedEventSourcedBehavior.withEventPublishing()
If usingReplicatedSharding
the replication can be enabled throughReplicatedEntityProvider.withDirectReplication
instead of starting this actor manually.Subscribes to locally written events through the event stream and sends the seen events to all the sharded replicas which can then fast forward their cross-replica event streams to improve latency while allowing less frequent poll for the cross replica queries. Note that since message delivery is at-most-once this can not be the only channel for replica events - the entities must still tail events from the journals of other replicas.
The events are forwarded as
ShardingEnvelope
this will work out of the box both by default and with a custom extractor since the envelopes are handled internally.
-
-
Field Summary
Fields Modifier and Type Field Description static ShardingDirectReplication$
MODULE$
Static reference to the singleton instance of this Scala object.
-
Constructor Summary
Constructors Constructor Description ShardingDirectReplication$()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description <T> Behavior<ShardingDirectReplication.Command>
apply(java.lang.String typeName, scala.Option<ReplicaId> selfReplica, scala.collection.immutable.Map<ReplicaId,ActorRef<T>> replicaShardingProxies)
-
-
-
Field Detail
-
MODULE$
public static final ShardingDirectReplication$ MODULE$
Static reference to the singleton instance of this Scala object.
-
-
Method Detail
-
apply
public <T> Behavior<ShardingDirectReplication.Command> apply(java.lang.String typeName, scala.Option<ReplicaId> selfReplica, scala.collection.immutable.Map<ReplicaId,ActorRef<T>> replicaShardingProxies)
-
-