Class CompositeCachingHealthCheckingActor

java.lang.Object
org.apache.pekko.actor.AbstractActor
org.apache.pekko.actor.AbstractActorWithTimers
org.eclipse.ditto.internal.utils.health.AbstractHealthCheckingActor
org.eclipse.ditto.internal.utils.health.CompositeCachingHealthCheckingActor
All Implemented Interfaces:
org.apache.pekko.actor.Actor, org.apache.pekko.actor.Timers

public final class CompositeCachingHealthCheckingActor extends AbstractHealthCheckingActor
Actor which provides the health of multiple underlying systems, such as messaging and persistence by aggregating the health by means of child actors. The child actors must answer RetrieveHealth requests with StatusInfo answers. The composite StatusInfo contains the StatusInfo of its children in the order of the child actors. The health statuses from the sub systems are retrieved in a configurable interval and cached in the meantime.
  • Nested Class Summary

    Nested classes/interfaces inherited from class org.apache.pekko.actor.AbstractActor

    org.apache.pekko.actor.AbstractActor.ActorContext, org.apache.pekko.actor.AbstractActor.Receive

    Nested classes/interfaces inherited from interface org.apache.pekko.actor.Actor

    org.apache.pekko.actor.Actor.emptyBehavior$, org.apache.pekko.actor.Actor.ignoringBehavior$
  • Field Summary

    Fields inherited from class org.eclipse.ditto.internal.utils.health.AbstractHealthCheckingActor

    ACTOR_NAME, log
  • Method Summary

    Modifier and Type
    Method
    Description
    protected org.apache.pekko.actor.AbstractActor.Receive
    Defines a AbstractActor.Receive for the messages to be handled by the subclass actor.
    void
     
    void
     
    static org.apache.pekko.actor.Props
    props(Map<String,org.apache.pekko.actor.Props> childActorProps, Duration updateInterval, boolean enabled)
    Creates Pekko configuration object Props for this CompositeCachingHealthCheckingActor.
    protected void
    Defines the action of the subclass actor which will be triggered when its health status is requested.

    Methods inherited from class org.eclipse.ditto.internal.utils.health.AbstractHealthCheckingActor

    createReceive, getHealth, updateHealth

    Methods inherited from class org.apache.pekko.actor.AbstractActorWithTimers

    aroundPostStop, aroundPreRestart, aroundReceive, getTimers, org$apache$pekko$actor$Timers$_setter_$org$apache$pekko$actor$Timers$$_timers_$eq, org$apache$pekko$actor$Timers$$_timers, timers

    Methods inherited from class org.apache.pekko.actor.AbstractActor

    aroundPostRestart, aroundPreStart, context, emptyBehavior, getContext, getSelf, getSender, org$apache$pekko$actor$Actor$_setter_$context_$eq, org$apache$pekko$actor$Actor$_setter_$self_$eq, postRestart, preRestart, preRestart, receive, receiveBuilder, self, sender, supervisorStrategy, unhandled

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface org.apache.pekko.actor.Actor

    aroundPostRestart, aroundPreStart, context, org$apache$pekko$actor$Actor$_setter_$context_$eq, org$apache$pekko$actor$Actor$_setter_$self_$eq, postRestart, preRestart, receive, self, sender, supervisorStrategy, unhandled
  • Method Details

    • props

      public static org.apache.pekko.actor.Props props(Map<String,org.apache.pekko.actor.Props> childActorProps, Duration updateInterval, boolean enabled)
      Creates Pekko configuration object Props for this CompositeCachingHealthCheckingActor.
      Parameters:
      childActorProps - the Props for creating child actors, each providing health for a different subsystem.
      updateInterval - the duration between the updates of the health (sub systems will be queried for their health in this interval).
      enabled - whether the health-check should be enabled.
      Returns:
      the Pekko configuration Props object
    • preStart

      public void preStart() throws Exception
      Specified by:
      preStart in interface org.apache.pekko.actor.Actor
      Overrides:
      preStart in class org.apache.pekko.actor.AbstractActor
      Throws:
      Exception
    • postStop

      public void postStop() throws Exception
      Specified by:
      postStop in interface org.apache.pekko.actor.Actor
      Overrides:
      postStop in class org.apache.pekko.actor.AbstractActor
      Throws:
      Exception
    • matchCustomMessages

      protected org.apache.pekko.actor.AbstractActor.Receive matchCustomMessages()
      Description copied from class: AbstractHealthCheckingActor
      Defines a AbstractActor.Receive for the messages to be handled by the subclass actor.
      Specified by:
      matchCustomMessages in class AbstractHealthCheckingActor
      Returns:
      the AbstractActor.Receive.
    • triggerHealthRetrieval

      protected void triggerHealthRetrieval()
      Description copied from class: AbstractHealthCheckingActor
      Defines the action of the subclass actor which will be triggered when its health status is requested.
      Specified by:
      triggerHealthRetrieval in class AbstractHealthCheckingActor