title: resilence4j+springboot2 circuit breaker is not opened
body: <p>I am trying to use resilence4j in my current spring boot2 project.I have written the following implementation classes.Even though i hit 1000 times CB is not opened.Could anyone please help finding what i was doing wrong.</p>
  <p><strong>mainclass</strong></p>
  <pre><code>@SpringBootApplication
  public class DemoApplication {
  
      public static void main(String[] args) {
          SpringApplication.run(DemoApplication.class, args);
      }
  
  }
  </code></pre>
  <p><strong>Controller class</strong></p>
  <pre><code>@RestController
  public class DemoController
  {
      @Autowired
      DemoService demoService;
  
      @GetMapping(&quot;/search&quot;)
      public String searchService()
      {
          return demoService.search();
  
      }
  
  }
  </code></pre>
  <p><strong>Service class with circuit breaker:</strong></p>
  <pre><code>@Component(value = &quot;demoService&quot;)
  public class DemoService
  {
  
      @CircuitBreaker(name = &quot;demoService&quot;,fallbackMethod = &quot;fallback&quot;)
      public String search()
      {
          throw new HttpServerErrorException(HttpStatus.INTERNAL_SERVER_ERROR, &quot;This is a remote exception&quot;);
      }
  
      public String fallback(Throwable throwable)
      {
          System.out.println(&quot;Entering fallback Method...........&quot;+throwable.getMessage());
          System.out.println(&quot;Circuit Breaker Opened&quot;);
          return &quot;Circuit Breaker Opened..&quot;;
      }
  }
  </code></pre>
  <p><strong>application.yml</strong></p>
  <pre><code>spring:
    application.name: demo
    jackson.serialization.indent_output: true
  
  server:
    port: 9080
  
  management.endpoints.web.exposure.include: '*'
  management.endpoint.health.show-details: always
  
  management.health.diskspace.enabled: false
  management.health.circuitbreakers.enabled: true
  management.health.ratelimiters.enabled: false
  
  info:
    name: ${spring.application.name}
    description: resilience4j demo
    environment: ${spring.profiles.active}
    version: 0.0.1
  
  management.metrics.tags.application: ${spring.application.name}
  management.metrics.distribution.percentiles-histogram.http.server.requests: true
  management.metrics.distribution.percentiles-histogram.resilience4j.circuitbreaker.calls: true
  
  #resilience4j.circuitbreaker.metrics.use_legacy_binder: true
  
  resilience4j.circuitbreaker:
    configs:
      default:
        registerHealthIndicator: true
        slidingWindowSize: 10
        minimumNumberOfCalls: 5
        permittedNumberOfCallsInHalfOpenState: 3
        automaticTransitionFromOpenToHalfOpenEnabled: true
        waitDurationInOpenState: 5s
        failureRateThreshold: 50
        eventConsumerBufferSize: 10
    instances:
      demoService:
        baseConfig: default
  </code></pre>
  <p><strong>pom.xml</strong></p>
  <pre><code>&lt;properties&gt;
      &lt;java.version&gt;11&lt;/java.version&gt;
  &lt;/properties&gt;
  
  &lt;dependencies&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;org.springframework.boot&lt;/groupId&gt;
          &lt;artifactId&gt;spring-boot-starter&lt;/artifactId&gt;
      &lt;/dependency&gt;
  
      &lt;dependency&gt;
          &lt;groupId&gt;org.springframework.boot&lt;/groupId&gt;
          &lt;artifactId&gt;spring-boot-starter-test&lt;/artifactId&gt;
          &lt;scope&gt;test&lt;/scope&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;org.springframework.boot&lt;/groupId&gt;
          &lt;artifactId&gt;spring-boot-autoconfigure&lt;/artifactId&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;org.springframework.boot&lt;/groupId&gt;
          &lt;artifactId&gt;spring-boot-starter-web&lt;/artifactId&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;io.github.resilience4j&lt;/groupId&gt;
          &lt;artifactId&gt;resilience4j-spring-boot2&lt;/artifactId&gt;
          &lt;version&gt;1.5.0&lt;/version&gt;
          &lt;type&gt;pom&lt;/type&gt;
      &lt;/dependency&gt;
       &lt;dependency&gt;
      &lt;groupId&gt;org.springframework.boot&lt;/groupId&gt;
      &lt;artifactId&gt;spring-boot-starter-aop&lt;/artifactId&gt;
      &lt;version&gt;2.3.0.RELEASE&lt;/version&gt;
  &lt;/dependency&gt;
  &lt;/dependencies&gt;
  
  &lt;build&gt;
      &lt;plugins&gt;
          &lt;plugin&gt;
              &lt;groupId&gt;org.springframework.boot&lt;/groupId&gt;
              &lt;artifactId&gt;spring-boot-maven-plugin&lt;/artifactId&gt;
          &lt;/plugin&gt;
      &lt;/plugins&gt;
  &lt;/build&gt;
  
  &lt;repositories&gt;
      &lt;repository&gt;
          &lt;id&gt;spring-milestones&lt;/id&gt;
          &lt;name&gt;Spring Milestones&lt;/name&gt;
          &lt;url&gt;https://repo.spring.io/milestone&lt;/url&gt;
      &lt;/repository&gt;
      &lt;repository&gt;
          &lt;id&gt;spring-snapshots&lt;/id&gt;
          &lt;name&gt;Spring Snapshots&lt;/name&gt;
          &lt;url&gt;https://repo.spring.io/snapshot&lt;/url&gt;
          &lt;snapshots&gt;
              &lt;enabled&gt;true&lt;/enabled&gt;
          &lt;/snapshots&gt;
      &lt;/repository&gt;
  &lt;/repositories&gt;
  &lt;pluginRepositories&gt;
      &lt;pluginRepository&gt;
          &lt;id&gt;spring-milestones&lt;/id&gt;
          &lt;name&gt;Spring Milestones&lt;/name&gt;
          &lt;url&gt;https://repo.spring.io/milestone&lt;/url&gt;
      &lt;/pluginRepository&gt;
      &lt;pluginRepository&gt;
          &lt;id&gt;spring-snapshots&lt;/id&gt;
          &lt;name&gt;Spring Snapshots&lt;/name&gt;
          &lt;url&gt;https://repo.spring.io/snapshot&lt;/url&gt;
          &lt;snapshots&gt;
              &lt;enabled&gt;true&lt;/enabled&gt;
          &lt;/snapshots&gt;
      &lt;/pluginRepository&gt;
  &lt;/pluginRepositories&gt;
  </code></pre>
  
  <p>For testing i used postman with 1000 repeated requests.</p>