Class HealthTrackerImpl
java.lang.Object
com.google.cloud.spring.pubsub.core.health.HealthTrackerImpl
- All Implemented Interfaces:
HealthTracker
Health tracker for a Pub/Sub subscription. The tracker will monitor messages being processed and
the subscription's message backlog. If backlog message size exceeds the message backlog
threshold, the tracker will return the number of messages over the threshold.
- Since:
- 2.0.6
-
Field Summary
Fields inherited from interface com.google.cloud.spring.pubsub.core.health.HealthTracker
UNDELIVERED_FILTER_TEMPLATE -
Constructor Summary
ConstructorsConstructorDescriptionHealthTrackerImpl(com.google.pubsub.v1.ProjectSubscriptionName projectSubscriptionName, com.google.cloud.monitoring.v3.MetricServiceClient metricServiceClient, Integer lagThreshold, Integer backlogThreshold, Integer lookUpInterval) -
Method Summary
Modifier and TypeMethodDescriptionlongIf messages have been processed recently returns zero.voidRecord that a message has been processed.com.google.pubsub.v1.ProjectSubscriptionNameAccessor for the Subscription being monitored by the tracker.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.google.cloud.spring.pubsub.core.health.HealthTracker
undeliveredFilter
-
Constructor Details
-
HealthTrackerImpl
-
-
Method Details
-
processedMessage
public void processedMessage()Description copied from interface:HealthTrackerRecord that a message has been processed.- Specified by:
processedMessagein interfaceHealthTracker
-
subscription
public com.google.pubsub.v1.ProjectSubscriptionName subscription()Description copied from interface:HealthTrackerAccessor for the Subscription being monitored by the tracker.- Specified by:
subscriptionin interfaceHealthTracker- Returns:
- the project subscription name
-
messagesOverThreshold
public long messagesOverThreshold()Description copied from interface:HealthTrackerIf messages have been processed recently returns zero. If no message have been recently processed the tracker will retrieve the number of messages in the subscription backlog. If the backlogs exceeds the threshold the messages over the threshold shall be returned.- Specified by:
messagesOverThresholdin interfaceHealthTracker- Returns:
- the messages over the threshold
-