org.apache.pekko.cluster.client

Members list

Type members

Classlikes

Declares a super type for all events emitted by the ClusterReceptionist. in relation to cluster clients being interacted with.

Declares a super type for all events emitted by the ClusterReceptionist. in relation to cluster clients being interacted with.

Attributes

Source
ClusterClient.scala
Supertypes
class Object
trait Matchable
class Any
Known subtypes
sealed trait ClusterClientMessage extends Serializable

Marker trait for remote messages with special serializer.

Marker trait for remote messages with special serializer.

Attributes

Source
ClusterClient.scala
Supertypes
trait Serializable
class Object
trait Matchable
class Any
final case class ClusterClientUnreachable(clusterClient: ActorRef) extends ClusterClientInteraction

Emitted to the Pekko event stream when a cluster client was previously connected but then not seen for some time.

Emitted to the Pekko event stream when a cluster client was previously connected but then not seen for some time.

Attributes

Source
ClusterClient.scala
Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all
final case class ClusterClientUp(clusterClient: ActorRef) extends ClusterClientInteraction

Emitted to the Pekko event stream when a cluster client has interacted with a receptionist.

Emitted to the Pekko event stream when a cluster client has interacted with a receptionist.

Attributes

Source
ClusterClient.scala
Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all
final case class ClusterClients(clusterClients: Set[ActorRef])

The reply to GetClusterClients.

The reply to GetClusterClients.

Value parameters

clusterClients

The presently known list of cluster clients.

Attributes

Source
ClusterClient.scala
Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all
final case class ContactPointAdded(contactPoint: ActorPath) extends ContactPointChange

Emitted to a subscriber when contact points have been received by the ClusterClient and a new one has been added.

Emitted to a subscriber when contact points have been received by the ClusterClient and a new one has been added.

Attributes

Source
ClusterClient.scala
Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all
sealed trait ContactPointChange

Declares a super type for all events emitted by the ClusterClient in relation to contact points being added or removed.

Declares a super type for all events emitted by the ClusterClient in relation to contact points being added or removed.

Attributes

Source
ClusterClient.scala
Supertypes
class Object
trait Matchable
class Any
Known subtypes
final case class ContactPointRemoved(contactPoint: ActorPath) extends ContactPointChange

Emitted to a subscriber when contact points have been received by the ClusterClient and a new one has been added.

Emitted to a subscriber when contact points have been received by the ClusterClient and a new one has been added.

Attributes

Source
ClusterClient.scala
Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all
final case class ContactPoints(contactPoints: Set[ActorPath])

The reply to GetContactPoints.

The reply to GetContactPoints.

Value parameters

contactPoints

The presently known list of contact points.

Attributes

Source
ClusterClient.scala
Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all
sealed abstract class GetClusterClients

Attributes

Companion
object
Source
ClusterClient.scala
Supertypes
class Object
trait Matchable
class Any
Known subtypes
case object GetClusterClients extends GetClusterClients

Get the cluster clients known to this receptionist. A ClusterClients message will be replied.

Get the cluster clients known to this receptionist. A ClusterClients message will be replied.

Attributes

Companion
class
Source
ClusterClient.scala
Supertypes
trait Singleton
trait Product
trait Mirror
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all
Self type
sealed abstract class GetContactPoints

Attributes

Companion
object
Source
ClusterClient.scala
Supertypes
class Object
trait Matchable
class Any
Known subtypes
case object GetContactPoints extends GetContactPoints

Get the contact points known to this client. A ContactPoints message will be replied.

Get the contact points known to this client. A ContactPoints message will be replied.

Attributes

Companion
class
Source
ClusterClient.scala
Supertypes
trait Singleton
trait Product
trait Mirror
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all
Self type
sealed abstract class SubscribeClusterClients

Attributes

Companion
object
Source
ClusterClient.scala
Supertypes
class Object
trait Matchable
class Any
Known subtypes

Subscribe to a cluster receptionist's client interactions where it is guaranteed that a sender receives the initial state of contact points prior to any events in relation to them changing. The sender will automatically become unsubscribed when it terminates.

Subscribe to a cluster receptionist's client interactions where it is guaranteed that a sender receives the initial state of contact points prior to any events in relation to them changing. The sender will automatically become unsubscribed when it terminates.

Attributes

Companion
class
Source
ClusterClient.scala
Supertypes
trait Singleton
trait Product
trait Mirror
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all
Self type
sealed abstract class SubscribeContactPoints

Attributes

Companion
object
Source
ClusterClient.scala
Supertypes
class Object
trait Matchable
class Any
Known subtypes

Subscribe to a cluster client's contact point changes where it is guaranteed that a sender receives the initial state of contact points prior to any events in relation to them changing. The sender will automatically become unsubscribed when it terminates.

Subscribe to a cluster client's contact point changes where it is guaranteed that a sender receives the initial state of contact points prior to any events in relation to them changing. The sender will automatically become unsubscribed when it terminates.

Attributes

Companion
class
Source
ClusterClient.scala
Supertypes
trait Singleton
trait Product
trait Mirror
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all
Self type
sealed abstract class UnsubscribeClusterClients

Attributes

Companion
object
Source
ClusterClient.scala
Supertypes
class Object
trait Matchable
class Any
Known subtypes

Explicitly unsubscribe from client interaction events.

Explicitly unsubscribe from client interaction events.

Attributes

Companion
class
Source
ClusterClient.scala
Supertypes
trait Singleton
trait Product
trait Mirror
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all
Self type
sealed abstract class UnsubscribeContactPoints

Attributes

Companion
object
Source
ClusterClient.scala
Supertypes
class Object
trait Matchable
class Any
Known subtypes

Explicitly unsubscribe from contact point change events.

Explicitly unsubscribe from contact point change events.

Attributes

Companion
class
Source
ClusterClient.scala
Supertypes
trait Singleton
trait Product
trait Mirror
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all
Self type

Deprecated classlikes

object ClusterClient

Attributes

Companion
class
Deprecated
[Since version Akka 2.6.0]
Source
ClusterClient.scala
Supertypes
class Object
trait Matchable
class Any
Self type
final class ClusterClient(settings: ClusterClientSettings) extends Actor, 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.

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.

Attributes

Companion
object
Deprecated
[Since version Akka 2.6.0]
Source
ClusterClient.scala
Supertypes
trait ActorLogging
trait Actor
class Object
trait Matchable
class Any

Attributes

Companion
class
Deprecated
[Since version Akka 2.6.0]
Source
ClusterClient.scala
Supertypes
class Object
trait Matchable
class Any
Self type

Extension that starts ClusterReceptionist and accompanying pekko.cluster.pubsub.DistributedPubSubMediator with settings defined in config section pekko.cluster.client.receptionist. The pekko.cluster.pubsub.DistributedPubSubMediator is started by the pekko.cluster.pubsub.DistributedPubSub extension.

Extension that starts ClusterReceptionist and accompanying pekko.cluster.pubsub.DistributedPubSubMediator with settings defined in config section pekko.cluster.client.receptionist. The pekko.cluster.pubsub.DistributedPubSubMediator is started by the pekko.cluster.pubsub.DistributedPubSub extension.

Attributes

Companion
object
Deprecated
[Since version Akka 2.6.0]
Source
ClusterClient.scala
Supertypes
trait Extension
class Object
trait Matchable
class Any

Attributes

Companion
class
Deprecated
[Since version Akka 2.6.0]
Source
ClusterClient.scala
Supertypes
class Object
trait Matchable
class Any
Self type
final class ClusterClientSettings(val initialContacts: Set[ActorPath], val establishingGetContactsInterval: FiniteDuration, val refreshContactsInterval: FiniteDuration, val heartbeatInterval: FiniteDuration, val acceptableHeartbeatPause: FiniteDuration, val bufferSize: Int, val reconnectTimeout: Option[FiniteDuration]) extends NoSerializationVerificationNeeded

Value parameters

acceptableHeartbeatPause

Number of potentially lost/delayed heartbeats that will be accepted before considering it to be an anomaly. The ClusterClient is using the pekko.remote.DeadlineFailureDetector, which will trigger if there are no heartbeats within the duration heartbeatInterval + acceptableHeartbeatPause.

bufferSize

If connection to the receptionist is not established the client will buffer this number of messages and deliver them the connection is established. When the buffer is full old messages will be dropped when new messages are sent via the client. Use 0 to disable buffering, i.e. messages will be dropped immediately if the location of the receptionist is unavailable.

establishingGetContactsInterval

Interval at which the client retries to establish contact with one of ClusterReceptionist on the servers (cluster nodes)

heartbeatInterval

How often failure detection heartbeat messages for detection of failed connections should be sent.

initialContacts

Actor paths of the ClusterReceptionist actors on the servers (cluster nodes) that the client will try to contact initially. It is mandatory to specify at least one initial contact. The path of the default receptionist is "pekko://system@hostname:port/system/receptionist"

reconnectTimeout

If the connection to the receptionist is lost and cannot be re-established within this duration the cluster client will be stopped. This makes it possible to watch it from another actor and possibly acquire a new list of initialContacts from some external service registry

refreshContactsInterval

Interval at which the client will ask the ClusterReceptionist for new contact points to be used for next reconnect.

Attributes

Companion
object
Deprecated
[Since version Akka 2.6.0]
Source
ClusterClient.scala
Supertypes
class Object
trait Matchable
class Any

Attributes

Companion
class
Deprecated
[Since version Akka 2.6.0]
Source
ClusterClient.scala
Supertypes
class Object
trait Matchable
class Any
Self type
final class ClusterReceptionist(pubSubMediator: ActorRef, settings: ClusterReceptionistSettings) extends Actor, ActorLogging

ClusterClient connects to this actor to retrieve. The ClusterReceptionist is supposed to be started on all nodes, or all nodes with specified role, in the cluster. The receptionist can be started with the ClusterClientReceptionist or as an ordinary actor (use the factory method ClusterReceptionist#props).

ClusterClient connects to this actor to retrieve. The ClusterReceptionist is supposed to be started on all nodes, or all nodes with specified role, in the cluster. The receptionist can be started with the ClusterClientReceptionist or as an ordinary actor (use the factory method ClusterReceptionist#props).

The receptionist forwards messages from the client to the associated pekko.cluster.pubsub.DistributedPubSubMediator, i.e. the client can send messages to any actor in the cluster that is registered in the DistributedPubSubMediator. Messages from the client are wrapped in pekko.cluster.pubsub.DistributedPubSubMediator.Send, pekko.cluster.pubsub.DistributedPubSubMediator.SendToAll or pekko.cluster.pubsub.DistributedPubSubMediator.Publish with the semantics described in pekko.cluster.pubsub.DistributedPubSubMediator.

Response messages from the destination actor are tunneled via the receptionist to avoid inbound connections from other cluster nodes to the client, i.e. the sender(), as seen by the destination actor, is not the client itself. The sender() of the response messages, as seen by the client, is deadLetters since the client should normally send subsequent messages via the ClusterClient. It is possible to pass the original sender inside the reply messages if the client is supposed to communicate directly to the actor in the cluster.

Attributes

Companion
object
Deprecated
[Since version Akka 2.6.0]
Source
ClusterClient.scala
Supertypes
trait ActorLogging
trait Actor
class Object
trait Matchable
class Any

Attributes

Companion
class
Deprecated
[Since version Akka 2.6.0]
Source
ClusterClient.scala
Supertypes
class Object
trait Matchable
class Any
Self type
final class ClusterReceptionistSettings(val role: Option[String], val numberOfContacts: Int, val responseTunnelReceiveTimeout: FiniteDuration) extends NoSerializationVerificationNeeded

Value parameters

numberOfContacts

The receptionist will send this number of contact points to the client

responseTunnelReceiveTimeout

The actor that tunnel response messages to the client will be stopped after this time of inactivity.

role

Start the receptionist on members tagged with this role. All members are used if undefined.

Attributes

Companion
object
Deprecated
[Since version Akka 2.6.0]
Source
ClusterClient.scala
Supertypes
class Object
trait Matchable
class Any