Class ClusterSnapshotPublisher
java.lang.Object
com.societegenerale.failover.observable.micrometer.AbstractSnapshotPublisher
com.societegenerale.failover.observable.micrometer.ThresholdSnapshotPublisher
com.societegenerale.failover.observable.micrometer.ClusterSnapshotPublisher
- All Implemented Interfaces:
SnapshotPublisher
Concrete
ThresholdSnapshotPublisher that builds a ClusterSnapshot from the local
FailoverMetricsSnapshotService and delivers it via a SnapshotPushClient.
Inherits time-threshold gating from ThresholdSnapshotPublisher (at most one push per
intervalSeconds) and event-driven dispatch from AbstractSnapshotPublisher (async,
virtual-thread executor injected by autoconfiguration; no push when the app is idle).
Owns backoff state: on first failure a single WARN is emitted and push() becomes a
no-op until retryIntervalSeconds elapses. On recovery an INFO is logged. Has no dependency
on any specific HTTP client — the transport is injected via SnapshotPushClient.
- Author:
- Anand Manissery
-
Constructor Summary
ConstructorsConstructorDescriptionClusterSnapshotPublisher(FailoverMetricsSnapshotService metricsService, FailoverConfigSnapshotService configSnapshotService, InstanceIdResolver instanceIdResolver, SnapshotPushClient pushClient, String publishUrl, int intervalSeconds, int retryIntervalSeconds, Executor executor) Creates a new publisher. -
Method Summary
Modifier and TypeMethodDescriptionvoidpush()Pushes the current snapshot to the receiver; must never throw.Methods inherited from class com.societegenerale.failover.observable.micrometer.ThresholdSnapshotPublisher
shouldPublishMethods inherited from class com.societegenerale.failover.observable.micrometer.AbstractSnapshotPublisher
onPublish
-
Constructor Details
-
ClusterSnapshotPublisher
public ClusterSnapshotPublisher(FailoverMetricsSnapshotService metricsService, FailoverConfigSnapshotService configSnapshotService, InstanceIdResolver instanceIdResolver, SnapshotPushClient pushClient, String publishUrl, int intervalSeconds, int retryIntervalSeconds, Executor executor) Creates a new publisher.- Parameters:
metricsService- source of this instance's metrics snapshotconfigSnapshotService- source of this instance's@FailoverconfigurationinstanceIdResolver- resolves this instance's identity for the pushed snapshotpushClient- transport used to deliver the snapshotpublishUrl- the dashboard's ingest endpoint URL (used only for logging here)intervalSeconds- minimum interval between pushesretryIntervalSeconds- backoff duration after a push failureexecutor- executor used to dispatch pushes off the metric-event thread
-
-
Method Details
-
push
public void push()Description copied from interface:SnapshotPublisherPushes the current snapshot to the receiver; must never throw.
-