Interface HealthTracker

All Known Implementing Classes:
HealthTrackerImpl

public interface 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
    Modifier and Type
    Field
    Description
    static final String
    Template for undelivered messages filter.
  • Method Summary

    Modifier and Type
    Method
    Description
    long
    If messages have been processed recently returns zero.
    void
    Record that a message has been processed.
    com.google.pubsub.v1.ProjectSubscriptionName
    Accessor for the Subscription being monitored by the tracker.
    default String
    undeliveredFilter(String subscriptionId)
    Creates a GCP Monitoring filter to query the message backlog of a Pub/Sub subscription.
  • Field Details

    • UNDELIVERED_FILTER_TEMPLATE

      static final String UNDELIVERED_FILTER_TEMPLATE
      Template for undelivered messages filter.
      See Also:
  • Method Details

    • processedMessage

      void processedMessage()
      Record that a message has been processed.
    • subscription

      com.google.pubsub.v1.ProjectSubscriptionName subscription()
      Accessor for the Subscription being monitored by the tracker.
      Returns:
      the project subscription name
    • messagesOverThreshold

      long messagesOverThreshold()
      If 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.
      Returns:
      the messages over the threshold
    • undeliveredFilter

      default String undeliveredFilter(String subscriptionId)
      Creates a GCP Monitoring filter to query the message backlog of a Pub/Sub subscription.
      Parameters:
      subscriptionId - the subscription id to add to the filter.
      Returns:
      Monitoring Pub/Sub Subscription filter for undelivered messages.