reduce cost of resilience4j metrics

This commit is contained in:
Jonathan Klabunde Tomer
2025-08-27 18:02:48 -07:00
committed by GitHub
parent 8fe87b77e4
commit 8e429e267f
2 changed files with 35 additions and 8 deletions

View File

@@ -32,14 +32,6 @@ import org.whispersystems.textsecuregcm.util.ResilienceUtil;
/**
* Adds a circuit breaker to every Netty {@link Channel} that gets created, so that a single unhealthy shard does not
* impact all cluster operations.
* <p>
* For metrics to be registered, users <em>must</em> create a synthetic {@link ClusterTopologyChangedEvent} after the
* initial connection. For example:
* <pre>
* clusterClient.connect();
* clusterClient.getResources().eventBus().publish(
* new ClusterTopologyChangedEvent(Collections.emptyList(), clusterClient.getPartitions().getPartitions()));
* </pre>
*/
public class LettuceShardCircuitBreaker implements NettyCustomizer {