Class ClusterClient
- All Implemented Interfaces:
- Actor,- ActorLogging
ClusterReceptionist somewhere in the cluster. It will
 monitor the connection to the receptionist and establish a new connection if
 the link goes down. When looking for a new receptionist it uses fresh contact
 points retrieved from previous establishment, or periodically refreshed
 contacts, i.e. not necessarily the initial contact points.
 
 You can send messages via the ClusterClient to any actor in the cluster
 that is registered in the ClusterReceptionist.
 Messages are wrapped in ClusterClient.Send, ClusterClient.SendToAll
 or ClusterClient.Publish.
 
 1. ClusterClient.Send -
 The message will be delivered to one recipient with a matching path, if any such
 exists. If several entries match the path the message will be delivered
 to one random destination. The sender of the message can specify that local
 affinity is preferred, i.e. the message is sent to an actor in the same local actor
 system as the used receptionist actor, if any such exists, otherwise random to any other
 matching entry.
 
 2. ClusterClient.SendToAll -
 The message will be delivered to all recipients with a matching path.
 
 3. ClusterClient.Publish -
 The message will be delivered to all recipients Actors that have been registered as subscribers to
 to the named topic.
 
  Use the factory method props(org.apache.pekko.cluster.client.ClusterClientSettings)) to create the
 pekko.actor.Props for the actor.
 
If the receptionist is not currently available, the client will buffer the messages and then deliver them when the connection to the receptionist has been established. The size of the buffer is configurable and it can be disabled by using a buffer size of 0. When the buffer is full old messages will be dropped when new messages are sent via the client.
Note that this is a best effort implementation: messages can always be lost due to the distributed nature of the actors involved.
- 
Nested Class SummaryNested ClassesModifier and TypeClassDescriptionstatic classDeprecated.INTERNAL APIstatic final classDeprecated.Use Apache Pekko gRPC instead, see https://pekko.apache.org/docs/pekko/current/cluster-client.html#migration-to-pekko-grpc.static classDeprecated.static final classDeprecated.Use Apache Pekko gRPC instead, see https://pekko.apache.org/docs/pekko/current/cluster-client.html#migration-to-pekko-grpc.static classDeprecated.static final classDeprecated.Use Apache Pekko gRPC instead, see https://pekko.apache.org/docs/pekko/current/cluster-client.html#migration-to-pekko-grpc.static classDeprecated.Nested classes/interfaces inherited from interface org.apache.pekko.actor.ActorActor.emptyBehavior$, Actor.ignoringBehavior$
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionscala.PartialFunction<Object,scala.runtime.BoxedUnit> Deprecated.buffer()Deprecated.voidDeprecated.voidbuffer_$eq(MessageBuffer x$1) Deprecated.scala.collection.immutable.HashSet<ActorPath>Deprecated.voidcontactPaths_$eq(scala.collection.immutable.HashSet<ActorPath> x$1) Deprecated.scala.collection.immutable.HashSet<ActorPath>Deprecated.voidcontactPathsPublished_$eq(scala.collection.immutable.HashSet<ActorPath> x$1) Deprecated.scala.PartialFunction<Object,scala.runtime.BoxedUnit> Deprecated.scala.collection.immutable.HashSet<ActorSelection>contacts()Deprecated.voidcontacts_$eq(scala.collection.immutable.HashSet<ActorSelection> x$1) Deprecated.context()Deprecated.Scala API: Stores the context for this actor, including self, and sender.scala.PartialFunction<Object,scala.runtime.BoxedUnit> Deprecated.Deprecated.Deprecated.scala.collection.immutable.HashSet<ActorSelection>Deprecated.protected voidDeprecated.Scala API: Stores the context for this actor, including self, and sender.protected final voidDeprecated.The 'self' field holds the ActorRef for this actor.voidpostStop()Deprecated.User overridable callback.static Propsprops(ClusterClientSettings settings) Deprecated.Use Apache Pekko gRPC instead, see https://pekko.apache.org/docs/pekko/current/cluster-client.html#migration-to-pekko-grpc.voidDeprecated.scala.PartialFunction<Object,scala.runtime.BoxedUnit> receive()Deprecated.Scala API: This defines the initial actor behavior, it must return a partial function with the actor logic.voidDeprecated.scala.Option<Cancellable>Deprecated.voidrefreshContactsTask_$eq(scala.Option<Cancellable> x$1) Deprecated.voidscheduleRefreshContactsTick(scala.concurrent.duration.FiniteDuration interval) Deprecated.final ActorRefself()Deprecated.The 'self' field holds the ActorRef for this actor.voidsendBuffered(ActorRef receptionist) Deprecated.voidDeprecated.scala.collection.immutable.Vector<ActorRef>Deprecated.voidsubscribers_$eq(scala.collection.immutable.Vector<ActorRef> x$1) Deprecated.Methods inherited from class java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.apache.pekko.actor.ActoraroundPostRestart, aroundPostStop, aroundPreRestart, aroundPreStart, aroundReceive, postRestart, preRestart, preStart, sender, supervisorStrategy, unhandledMethods inherited from interface org.apache.pekko.actor.ActorLogging_log_$eq, log
- 
Constructor Details- 
ClusterClientDeprecated.
 
- 
- 
Method Details- 
propsDeprecated.Use Apache Pekko gRPC instead, see https://pekko.apache.org/docs/pekko/current/cluster-client.html#migration-to-pekko-grpc. Since Akka 2.6.0.Scala API: Factory method forClusterClientpekko.actor.Props.
- 
contextDeprecated.Description copied from interface:ActorScala API: Stores the context for this actor, including self, and sender. It is implicit to support operations such asforward.WARNING: Only valid within the Actor itself, so do not close over it and publish it to other threads! pekko.actor.ActorContextis the Scala API.getContextreturns apekko.actor.AbstractActor.ActorContext, which is the Java API of the actor context.
- 
selfDeprecated.Description copied from interface:ActorThe 'self' field holds the ActorRef for this actor. Can be used to send messages to itself:self ! message 
- 
org$apache$pekko$actor$Actor$_setter_$context_$eqDeprecated.Description copied from interface:ActorScala API: Stores the context for this actor, including self, and sender. It is implicit to support operations such asforward.WARNING: Only valid within the Actor itself, so do not close over it and publish it to other threads! pekko.actor.ActorContextis the Scala API.getContextreturns apekko.actor.AbstractActor.ActorContext, which is the Java API of the actor context.- Specified by:
- org$apache$pekko$actor$Actor$_setter_$context_$eqin interface- Actor
 
- 
org$apache$pekko$actor$Actor$_setter_$self_$eqDeprecated.Description copied from interface:ActorThe 'self' field holds the ActorRef for this actor. Can be used to send messages to itself:self ! message - Specified by:
- org$apache$pekko$actor$Actor$_setter_$self_$eqin interface- Actor
 
- 
failureDetectorDeprecated.
- 
contactPathsDeprecated.
- 
contactPaths_$eqDeprecated.
- 
initialContactsSelDeprecated.
- 
contactsDeprecated.
- 
contacts_$eqDeprecated.
- 
contactPathsPublishedDeprecated.
- 
contactPathsPublished_$eqDeprecated.
- 
subscribersDeprecated.
- 
subscribers_$eqDeprecated.
- 
heartbeatTaskDeprecated.
- 
refreshContactsTaskDeprecated.
- 
refreshContactsTask_$eqDeprecated.
- 
bufferDeprecated.
- 
buffer_$eqDeprecated.
- 
scheduleRefreshContactsTickpublic void scheduleRefreshContactsTick(scala.concurrent.duration.FiniteDuration interval) Deprecated.
- 
postStoppublic void postStop()Deprecated.Description copied from interface:ActorUser overridable callback. Is called asynchronously after 'actor.stop()' is invoked. Empty default implementation.
- 
receiveDeprecated.Description copied from interface:ActorScala API: This defines the initial actor behavior, it must return a partial function with the actor logic.
- 
establishingDeprecated.
- 
activeDeprecated.
- 
contactPointMessagesDeprecated.
- 
sendGetContactspublic void sendGetContacts()Deprecated.
- 
bufferDeprecated.
- 
sendBufferedDeprecated.
- 
publishContactPointspublic void publishContactPoints()Deprecated.
- 
reestablishpublic void reestablish()Deprecated.
 
-