resilience4j + spring boot 2 + EndpointAutoConfiguration类未找到异常

时间:2019-11-14 07:07:37

标签: java spring spring-boot resilience4j

Resilience4j版本:1.1.0

Java版本:1.8

春季靴:2.2.0

我正在尝试使用Spring Boot项目配置Resilience4j,但是找不到下面的类

org.springframework.boot.SpringApplication:应用程序运行失败 java.lang.IllegalArgumentException:找不到类[ org.springframework.boot.actuate.autoconfigure.endpoint.EndpointAutoConfiguration ] 在org.springframework.util.ClassUtils.resolveClassName(ClassUtils.java:327)

Java代码如下

@RateLimiter(name ="service1",fallbackMethod = "rateLimiterfallback")
    @PostMapping(value = "${URL_AUTH}")
    public ResponseEntity<AuthRespDTO> fetchToken(@RequestParam("userId") String Id, @RequestParam("password") String pwd, HttpServletRequest httpRequest) { 
    }

application.yml如下

resilience4j.ratelimiter:
    instances:
    service1:
      limitForPeriod: 1
      limitRefreshPeriod: 100000
      timeoutDuration: 1000ms

我在POM.xml中提到了以下依赖项。

<dependency>
    <groupId>io.github.resilience4j</groupId>
    <artifactId>resilience4j-spring-boot2</artifactId>
    <version>1.1.0</version>
</dependency>

<dependency>
    <groupId>io.github.resilience4j</groupId>
    <artifactId>resilience4j-ratelimiter</artifactId>
    <version>1.1.0</version>
</dependency>

<dependency>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-actuator</artifactId>
    <version>2.2.0.RELEASE</version>
</dependency>

请帮助我解决问题。

0 个答案:

没有答案