Class GrpcCircuitBreakerRegistry
java.lang.Object
io.micronaut.grpc.client.circuitbreaker.GrpcCircuitBreakerRegistry
@Singleton
@Requires(classes=io.micronaut.retry.CircuitBreakerOperationsFactory.class)
public class GrpcCircuitBreakerRegistry
extends Object
Holds one circuit breaker per gRPC channel that enables
grpc.channels.<name>.circuit-breaker.enabled.
All stubs created from the same channel share its circuit breaker.
Requires io.micronaut:micronaut-retry on the classpath.
- Since:
- 5.3.0
-
Constructor Summary
ConstructorsConstructorDescriptionGrpcCircuitBreakerRegistry(io.micronaut.context.ApplicationContext context, io.micronaut.retry.CircuitBreakerOperationsFactory operationsFactory, ExecutorService ioExecutor) -
Method Summary
Modifier and TypeMethodDescriptionOptional<io.micronaut.retry.CircuitState> currentState(String channelName) Returns the state of a channel's circuit breaker.Optional<io.grpc.ClientInterceptor> findInterceptor(String channelName) Returns the circuit breaker interceptor of a channel, if its circuit breaker is enabled.
-
Constructor Details
-
GrpcCircuitBreakerRegistry
public GrpcCircuitBreakerRegistry(io.micronaut.context.ApplicationContext context, io.micronaut.retry.CircuitBreakerOperationsFactory operationsFactory, @Named("io") ExecutorService ioExecutor) - Parameters:
context- The application contextoperationsFactory- The factory for circuit breaker operationsioExecutor- The executor that runs the callbacks of rejected calls when neither the call nor the channel configuration specifies one
-
-
Method Details
-
findInterceptor
-
currentState
-