public interface HealthTrackerRegistry
HealthTracker
health trackers created per ProjectSubscriptionName
.Modifier and Type | Method and Description |
---|---|
void |
addListener(Subscriber subscriber)
Attaches a listener to a Pub/Sub subscriber provided a
HealthTracker is registered for that subscription. |
Collection<HealthTracker> |
healthTrackers()
Retrieve all the health trackers registered.
|
boolean |
isTracked(com.google.pubsub.v1.ProjectSubscriptionName projectSubscriptionName)
Check if a
ProjectSubscriptionName has a HealthTracker registered. |
void |
processedMessage(com.google.pubsub.v1.ProjectSubscriptionName projectSubscriptionName)
Propagate that a message has been processed to the corresponding
HealthTracker if registered. |
HealthTracker |
registerTracker(com.google.pubsub.v1.ProjectSubscriptionName projectSubscriptionName)
Create a tracker for given
ProjectSubscriptionName and add tracker to registry. |
HealthTracker |
registerTracker(String subscriptionName)
Create a tracker for given subscription name and add tracker to registry.
|
default MessageReceiver |
wrap(com.google.pubsub.v1.ProjectSubscriptionName subscriptionName,
MessageReceiver messageReceiver)
Wrap a message receiver for a
ProjectSubscriptionName . |
HealthTracker registerTracker(String subscriptionName)
subscriptionName
- the subscription name to create a ProjectSubscriptionName
using the default project-Id.HealthTracker
that has been created and registered.HealthTracker registerTracker(com.google.pubsub.v1.ProjectSubscriptionName projectSubscriptionName)
ProjectSubscriptionName
and add tracker to registry.projectSubscriptionName
- the full subscription nameHealthTracker
that has been created and registered.boolean isTracked(com.google.pubsub.v1.ProjectSubscriptionName projectSubscriptionName)
ProjectSubscriptionName
has a HealthTracker
registered.projectSubscriptionName
- the full subscription name.HealthTracker
is registered.default MessageReceiver wrap(com.google.pubsub.v1.ProjectSubscriptionName subscriptionName, MessageReceiver messageReceiver)
ProjectSubscriptionName
.
A HealthTracker
will be created and registered. On a new message received the registered HealthTracker
will record its processing.subscriptionName
- the full ProjectSubscriptionName
name to monitor.messageReceiver
- the MessageReceiver
to wrap.MessageReceiver
.void processedMessage(com.google.pubsub.v1.ProjectSubscriptionName projectSubscriptionName)
HealthTracker
if registered.projectSubscriptionName
- the full ProjectSubscriptionName
name to monitor.void addListener(Subscriber subscriber)
HealthTracker
is registered for that subscription.
On subscriber termination, the corresponding HealthTracker
shall be removed from the registry.subscriber
- the subscriber to attach a listener.Collection<HealthTracker> healthTrackers()
Copyright © 2021. All rights reserved.