'Trying to replicate Circuit Breaker is Open but circuitBreakersHealthIndicator is UP and Green

Am inspecting a Spring WebFlux microservice which uses reslience4j lib as the circuit breaker. Am fairly new to both Spring WebFlux and reslience4j along w/ the circuit breaker pattern, in general.

This microservice hits a DynamoDB instance on AWS and a developer noticed an irregularity where when pointing to:

http://localhost:8080/internal/status

That despite the circuitBreakersHealthIndicator's result is UP and in green, the getCircuitBreaker=CIRCUIT_OPEN and the state=OPEN.

CIRCUIT_OPEN_BUT_STATUS_IS_GREEN

Shouldn't the result be DOWN and in red?


The versions of the libs used in this Spring WebFlux microservice.

Spring Boot 2.3.11.RELEASE Spring WebFlux 5.2.15.RELEASE

pom.xml:

<dependency>
    <groupId>org.springframework.cloud</groupId>
    <artifactId>spring-cloud-starter-circuitbreaker-resilience4j</artifactId>
    <version>1.7.0</version>
</dependency>

Inside app/src/main/java/resources/application.yml:

aws:
  region: us-west-2
  profileName: dev-server
  profileRefreshIntervalMinutes: 5
  dynamodb:
    maxConnections: 400
    timeoutMs: 450
    maxRetries: 2
    tableName: 'my_table'
    itemTTLDays: 30

resilience4j.circuitbreaker:
  instances:
    postCircuitBreaker:
      registerHealthIndicator: true
      failureRateThreshold: 50
      minimumNumberOfCalls: 100
      slidingWindowType: COUNT_BASED
      slidingWindowSize: 100
    getCircuitBreaker:
      registerHealthIndicator: true
      failureRateThreshold: 50
      minimumNumberOfCalls: 100
      slidingWindowType: COUNT_BASED
      slidingWindowSize: 100

management:
  health:
    circuitbreakers:
      enabled: true

ServiceImpl.java:

@Override
@CircuitBreaker(name = Resilience4JConstants.GET_CIRCUITBREAKER_NAME)
public List<Output> getItems(String accountId) {
    // standard way to using a custom dynamo client using accountId
}

@Override
@CircuitBreaker(name = Resilience4JConstants.POST_CIRCUITBREAKER_NAME)
public void storeItem(Input input) {

    // Convert input into DynamoDB Item
    Map<String, AttributeValue> item = DynamoDbUtil.convertIntoDynamoDbMap(input);

    // use custom dynamo client to put item into a table name
}

Been trying to replicate this using heaving loads with JMeter (both from the CLI and JMeter UI) but it keeps coming up like this, the getCircuitBreaker=UP and the state=CLOSED:

CIRCUIT_IS_UP_AND_STATE_IS_CLOSED


Anyone know the best way (changing config settings, using JMeter, etc) to try to replicate the first screenshot which is an obvious bug/irregularity?

Also, has anyone experienced this before (circuitBreakersHealthIndicator's result is UP and in green, whereas the getCircuitBreaker=CIRCUIT_OPEN and the state=OPEN)?

Any additional strategies and/or tactics would be greatly appreciated.



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source