Events Stream

To receive some system events and act on them for some particular business cases, you just need to call the actor system Subscribe. Make sure to Unsubscribe whenever the subscription is no longer needed to free allocated resources. The subscription methods can be found on the ActorSystem interface.

Supported events

  • ActorStarted: emitted when an actor has started

  • ActorStopped: emitted when an actor has stopped

  • ActorPassivated: emitted when an actor is passivated

  • ActorChildCreated: emitted when a child actor is created

  • ActorRestarted: emitted when an actor has restarted

  • ActorSuspended: emitted when an actor has been suspended

  • NodeJoined: cluster event emitted when a node joins the cluster. This only happens when cluster mode is enabled

  • NodeLeft: cluster event emitted when a node leaves the cluster. This only happens when cluster mode is enabled

  • Deadletter: emitted when a message cannot be delivered or that were not handled by a given actor. Dead letters are automatically emitted when a message cannot be delivered to actors' mailbox or when an Ask times out. Also, one can emit dead letters from the receiving actor by using the ctx.Unhandled() method. This is useful instead of panicking when the receiving actor does not know how to handle a particular message. Dead letters are not propagated over the network, there are tied to the local actor system.

Note

Events that are not handled will be dropped because there is no persistence layer or a replay mechanism. There are processed as they come into the stream.

Last updated