final class ClusterClient extends Actor with ActorLogging

This actor is intended to be used on an external node that is not member of the cluster. It acts like a gateway for sending messages to actors somewhere in the cluster. From the initial contact points it will establish a connection to a 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 ClusterClient#props) 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.

Annotations
@deprecated
Deprecated

(Since version Akka 2.6.0) Use Apache Pekko gRPC instead, see https://pekko.apache.org/docs/pekko/current/cluster-client.html#migration-to-pekko-grpc

Linear Supertypes
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. ClusterClient
  2. ActorLogging
  3. Actor
  4. AnyRef
  5. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. Protected

Instance Constructors

  1. new ClusterClient(settings: ClusterClientSettings)

Type Members

  1. type Receive = PartialFunction[Any, Unit]
    Definition Classes
    Actor

Value Members

  1. final def !=(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  2. final def ##: Int
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  4. def active(receptionist: ActorRef): actor.Actor.Receive
  5. def aroundPostRestart(reason: Throwable): Unit
    Attributes
    protected[pekko]
    Definition Classes
    Actor
    Annotations
    @InternalApi()
  6. def aroundPostStop(): Unit
    Attributes
    protected[pekko]
    Definition Classes
    Actor
    Annotations
    @InternalApi()
  7. def aroundPreRestart(reason: Throwable, message: Option[Any]): Unit
    Attributes
    protected[pekko]
    Definition Classes
    Actor
    Annotations
    @InternalApi()
  8. def aroundPreStart(): Unit
    Attributes
    protected[pekko]
    Definition Classes
    Actor
    Annotations
    @InternalApi()
  9. def aroundReceive(receive: actor.Actor.Receive, msg: Any): Unit
    Attributes
    protected[pekko]
    Definition Classes
    Actor
    Annotations
    @InternalApi()
  10. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  11. def buffer(msg: Any): Unit
  12. var buffer: MessageBuffer
  13. def clone(): AnyRef
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.CloneNotSupportedException]) @native() @HotSpotIntrinsicCandidate()
  14. var contactPaths: HashSet[ActorPath]
  15. var contactPathsPublished: HashSet[ActorPath]
  16. def contactPointMessages: actor.Actor.Receive
  17. var contacts: HashSet[ActorSelection]
  18. implicit val context: ActorContext
    Definition Classes
    Actor
  19. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  20. def equals(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef → Any
  21. def establishing: actor.Actor.Receive
  22. val failureDetector: DeadlineFailureDetector
  23. final def getClass(): Class[_ <: AnyRef]
    Definition Classes
    AnyRef → Any
    Annotations
    @native() @HotSpotIntrinsicCandidate()
  24. def hashCode(): Int
    Definition Classes
    AnyRef → Any
    Annotations
    @native() @HotSpotIntrinsicCandidate()
  25. val heartbeatTask: Cancellable
  26. val initialContactsSel: HashSet[ActorSelection]
  27. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  28. def log: LoggingAdapter
    Definition Classes
    ActorLogging
  29. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  30. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native() @HotSpotIntrinsicCandidate()
  31. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native() @HotSpotIntrinsicCandidate()
  32. def postRestart(reason: Throwable): Unit
    Definition Classes
    Actor
    Annotations
    @throws(classOf[java.lang.Exception])
  33. def postStop(): Unit
    Definition Classes
    ClusterClient → Actor
  34. def preRestart(reason: Throwable, message: Option[Any]): Unit
    Definition Classes
    Actor
    Annotations
    @throws(classOf[java.lang.Exception])
  35. def preStart(): Unit
    Definition Classes
    Actor
    Annotations
    @throws(classOf[java.lang.Exception])
  36. def publishContactPoints(): Unit
  37. def receive: PartialFunction[Any, Unit]
    Definition Classes
    ClusterClient → Actor
  38. def reestablish(): Unit
  39. var refreshContactsTask: Option[Cancellable]
  40. def scheduleRefreshContactsTick(interval: FiniteDuration): Unit
  41. implicit final val self: ActorRef
    Definition Classes
    Actor
  42. def sendBuffered(receptionist: ActorRef): Unit
  43. def sendGetContacts(): Unit
  44. final def sender(): ActorRef
    Definition Classes
    Actor
  45. var subscribers: Vector[ActorRef]
  46. def supervisorStrategy: SupervisorStrategy
    Definition Classes
    Actor
  47. final def synchronized[T0](arg0: => T0): T0
    Definition Classes
    AnyRef
  48. def toString(): String
    Definition Classes
    AnyRef → Any
  49. def unhandled(message: Any): Unit
    Definition Classes
    Actor
  50. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  51. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException]) @native()
  52. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])

Deprecated Value Members

  1. def finalize(): Unit
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.Throwable]) @Deprecated @Deprecated
    Deprecated

Inherited from ActorLogging

Inherited from Actor

Inherited from AnyRef

Inherited from Any

Ungrouped