public class PubSubHealthIndicator extends org.springframework.boot.actuate.health.AbstractHealthIndicator
HealthIndicatorfor Pub/Sub. Validates if connection is successful by pulling messages from the pubSubTemplate using
PubSubTemplate.pullAsync(String, Integer, Boolean).
If a custom subscription has been specified, this health indicator will signal "up" if messages are successfully pulled and (optionally) acknowledged or if a successful pull is performed but no messages are returned from Pub/Sub.
If no subscription has been specified, this health indicator will pull messages from a random
subscription that is expected not to exist. It will signal "up" if it is able to connect to GCP
Pub/Sub APIs, i.e. the pull results in a response of
Note that messages pulled from the subscription will not be acknowledged, unless you set the
acknowledgeMessages option to "true". However, take care not to configure a subscription
that has a business impact, or leave the custom subscription out completely.
|Constructor and Description|
|Modifier and Type||Method and Description|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Copyright © 2022. All rights reserved.