final class ClusterSingletonProxy extends Actor with ActorLogging

The ClusterSingletonProxy works together with the akka.cluster.singleton.ClusterSingletonManager to provide a distributed proxy to the singleton actor.

The proxy can be started on every node where the singleton needs to be reached and used as if it were the singleton itself. It will then act as a router to the currently running singleton instance. If the singleton is not currently available, e.g., during hand off or startup, the proxy will buffer the messages sent to the singleton and then deliver them when the singleton is finally available. 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 proxy.

The proxy works by keeping track of the oldest cluster member. When a new oldest member is identified, e.g. because the older one left the cluster, or at startup, the proxy will try to identify the singleton on the oldest member by periodically sending an akka.actor.Identify message until the singleton responds with its akka.actor.ActorIdentity.

Note that this is a best effort implementation: messages can always be lost due to the distributed nature of the actors involved.

Source
ClusterSingletonProxy.scala
Linear Supertypes
Type Hierarchy
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. ClusterSingletonProxy
  2. ActorLogging
  3. Actor
  4. AnyRef
  5. Any
Implicitly
  1. by any2stringadd
  2. by StringFormat
  3. by Ensuring
  4. by ArrowAssoc
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Instance Constructors

  1. new ClusterSingletonProxy(singletonManagerPath: String, settings: ClusterSingletonProxySettings)

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. def +(other: String): String
    Implicit
    This member is added by an implicit conversion from ClusterSingletonProxy to any2stringadd[ClusterSingletonProxy] performed by method any2stringadd in scala.Predef.
    Definition Classes
    any2stringadd
  4. def ->[B](y: B): (ClusterSingletonProxy, B)
    Implicit
    This member is added by an implicit conversion from ClusterSingletonProxy to ArrowAssoc[ClusterSingletonProxy] performed by method ArrowAssoc in scala.Predef.
    Definition Classes
    ArrowAssoc
    Annotations
    @inline()
  5. final def ==(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  6. def add(m: Member): Unit

    Adds new member if it has the right role.

    Adds new member if it has the right role.

    m

    New cluster member.

  7. val ageOrdering: Ordering[Member]
  8. def aroundPostRestart(reason: Throwable): Unit
    Attributes
    protected[akka]
    Definition Classes
    Actor
    Annotations
    @InternalApi()
  9. def aroundPostStop(): Unit
    Attributes
    protected[akka]
    Definition Classes
    Actor
    Annotations
    @InternalApi()
  10. def aroundPreRestart(reason: Throwable, message: Option[Any]): Unit
    Attributes
    protected[akka]
    Definition Classes
    Actor
    Annotations
    @InternalApi()
  11. def aroundPreStart(): Unit
    Attributes
    protected[akka]
    Definition Classes
    Actor
    Annotations
    @InternalApi()
  12. def aroundReceive(receive: actor.Actor.Receive, msg: Any): Unit
    Attributes
    protected[akka]
    Definition Classes
    Actor
    Annotations
    @InternalApi()
  13. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  14. def buffer(msg: Any): Unit
  15. var buffer: MessageBuffer
  16. def cancelTimer(): Unit
  17. def clone(): AnyRef
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @native() @HotSpotIntrinsicCandidate() @throws( ... )
  18. val cluster: Cluster
  19. implicit val context: ActorContext
    Definition Classes
    Actor
  20. def createIdentifyId(i: Int): String
  21. def ensuring(cond: (ClusterSingletonProxy) ⇒ Boolean, msg: ⇒ Any): ClusterSingletonProxy
    Implicit
    This member is added by an implicit conversion from ClusterSingletonProxy to Ensuring[ClusterSingletonProxy] performed by method Ensuring in scala.Predef.
    Definition Classes
    Ensuring
  22. def ensuring(cond: (ClusterSingletonProxy) ⇒ Boolean): ClusterSingletonProxy
    Implicit
    This member is added by an implicit conversion from ClusterSingletonProxy to Ensuring[ClusterSingletonProxy] performed by method Ensuring in scala.Predef.
    Definition Classes
    Ensuring
  23. def ensuring(cond: Boolean, msg: ⇒ Any): ClusterSingletonProxy
    Implicit
    This member is added by an implicit conversion from ClusterSingletonProxy to Ensuring[ClusterSingletonProxy] performed by method Ensuring in scala.Predef.
    Definition Classes
    Ensuring
  24. def ensuring(cond: Boolean): ClusterSingletonProxy
    Implicit
    This member is added by an implicit conversion from ClusterSingletonProxy to Ensuring[ClusterSingletonProxy] performed by method Ensuring in scala.Predef.
    Definition Classes
    Ensuring
  25. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  26. def equals(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  27. def formatted(fmtstr: String): String
    Implicit
    This member is added by an implicit conversion from ClusterSingletonProxy to StringFormat[ClusterSingletonProxy] performed by method StringFormat in scala.Predef.
    Definition Classes
    StringFormat
    Annotations
    @inline()
  28. final def getClass(): Class[_]
    Definition Classes
    AnyRef → Any
    Annotations
    @native() @HotSpotIntrinsicCandidate()
  29. def handleInitial(state: CurrentClusterState): Unit
  30. def hashCode(): Int
    Definition Classes
    AnyRef → Any
    Annotations
    @native() @HotSpotIntrinsicCandidate()
  31. var identifyCounter: Int
  32. var identifyId: String
  33. def identifySingleton(): Unit

    Discard old singleton ActorRef and send a periodic message to self to identify the singleton.

  34. var identifyTimer: Option[Cancellable]
  35. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  36. def log: LoggingAdapter
    Definition Classes
    ActorLogging
  37. def matchingRole(member: Member): Boolean
  38. var membersByAge: SortedSet[Member]
  39. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  40. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native() @HotSpotIntrinsicCandidate()
  41. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native() @HotSpotIntrinsicCandidate()
  42. def postRestart(reason: Throwable): Unit
    Definition Classes
    Actor
    Annotations
    @throws( classOf[java.lang.Exception] )
  43. def postStop(): Unit
    Definition Classes
    ClusterSingletonProxy → Actor
  44. def preRestart(reason: Throwable, message: Option[Any]): Unit
    Definition Classes
    Actor
    Annotations
    @throws( classOf[java.lang.Exception] )
  45. def preStart(): Unit
    Definition Classes
    ClusterSingletonProxy → Actor
  46. def receive: PartialFunction[Any, Unit]
    Definition Classes
    ClusterSingletonProxy → Actor
  47. def remove(m: Member): Unit

    Removes a member.

    Removes a member.

    m

    Cluster member to remove.

  48. implicit final val self: ActorRef
    Definition Classes
    Actor
  49. def sendBuffered(): Unit
  50. final def sender(): ActorRef
    Definition Classes
    Actor
  51. var singleton: Option[ActorRef]
  52. val singletonPath: Array[String]
  53. def supervisorStrategy: SupervisorStrategy
    Definition Classes
    Actor
  54. final def synchronized[T0](arg0: ⇒ T0): T0
    Definition Classes
    AnyRef
  55. def toString(): String
    Definition Classes
    AnyRef → Any
  56. def trackChange(block: () ⇒ Unit): Unit
  57. def unhandled(message: Any): Unit
    Definition Classes
    Actor
  58. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  59. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @native() @throws( ... )
  60. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  61. def [B](y: B): (ClusterSingletonProxy, B)
    Implicit
    This member is added by an implicit conversion from ClusterSingletonProxy to ArrowAssoc[ClusterSingletonProxy] performed by method ArrowAssoc in scala.Predef.
    Definition Classes
    ArrowAssoc

Deprecated Value Members

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

    (Since version ) see corresponding Javadoc for more information.

Inherited from ActorLogging

Inherited from Actor

Inherited from AnyRef

Inherited from Any

Inherited by implicit conversion any2stringadd from ClusterSingletonProxy to any2stringadd[ClusterSingletonProxy]

Inherited by implicit conversion StringFormat from ClusterSingletonProxy to StringFormat[ClusterSingletonProxy]

Inherited by implicit conversion Ensuring from ClusterSingletonProxy to Ensuring[ClusterSingletonProxy]

Inherited by implicit conversion ArrowAssoc from ClusterSingletonProxy to ArrowAssoc[ClusterSingletonProxy]

Ungrouped