Class ShardingDirectReplication
Used when sharding Replicated Event Sourced entities in multiple instances of sharding, for example one per DC in a Multi DC Pekko 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 pekko.persistence.typed.scaladsl.EventSourcedBehavior.withEventPublishing
or pekko.persistence.typed.javadsl.ReplicatedEventSourcedBehavior#withEventPublishing()
If using ReplicatedSharding the replication can be enabled through ReplicatedEntityProvider.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 pekko.cluster.sharding.typed.ShardingEnvelope this will work out of the box both
by default and with a custom extractor since the envelopes are handled internally.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interfaceNot for user extensionstatic class -
Constructor Summary
Constructors -
Method Summary
-
Constructor Details
-
ShardingDirectReplication
public ShardingDirectReplication()
-
-
Method Details
-
apply
-