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
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.ReceiveNested 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 TypeMethodDescriptionprotected org.apache.pekko.actor.AbstractActor.ReceiveDefines aAbstractActor.Receivefor the messages to be handled by the subclass actor.voidpostStop()voidpreStart()static org.apache.pekko.actor.Propsprops(Map<String, org.apache.pekko.actor.Props> childActorProps, Duration updateInterval, boolean enabled) Creates Pekko configuration object Props for thisCompositeCachingHealthCheckingActor.protected voidDefines 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, updateHealthMethods 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, timersMethods 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, unhandledMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods 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 thisCompositeCachingHealthCheckingActor.- 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
- Specified by:
preStartin interfaceorg.apache.pekko.actor.Actor- Overrides:
preStartin classorg.apache.pekko.actor.AbstractActor- Throws:
Exception
-
postStop
- Specified by:
postStopin interfaceorg.apache.pekko.actor.Actor- Overrides:
postStopin classorg.apache.pekko.actor.AbstractActor- Throws:
Exception
-
matchCustomMessages
protected org.apache.pekko.actor.AbstractActor.Receive matchCustomMessages()Description copied from class:AbstractHealthCheckingActorDefines aAbstractActor.Receivefor the messages to be handled by the subclass actor.- Specified by:
matchCustomMessagesin classAbstractHealthCheckingActor- Returns:
- the
AbstractActor.Receive.
-
triggerHealthRetrieval
protected void triggerHealthRetrieval()Description copied from class:AbstractHealthCheckingActorDefines the action of the subclass actor which will be triggered when its health status is requested.- Specified by:
triggerHealthRetrievalin classAbstractHealthCheckingActor
-