我正在使用io.github.resilience4j。在1.6.1版本中一切正常,但在升级到1.7.1版本时,我的应用程序无法运行。请在下面找到我的代码更改。
我的pom.xml依赖项
<dependency>
<groupId>io.github.resilience4j</groupId>
<artifactId>resilience4j-core</artifactId>
<version>1.7.1</version>
</dependency>
<dependency>
<groupId>io.github.resilience4j</groupId>
<artifactId>resilience4j-spring-boot2</artifactId>
<version>1.7.1</version>
</dependency>
这是应用程序。
resilience4j.circuitbreaker.configs.default.registerHealthIndicator=true
resilience4j.circuitbreaker.configs.default.slidingWindowSize= 10
resilience4j.circuitbreaker.configs.default.minimumNumberOfCalls=5
resilience4j.circuitbreaker.configs.default.permittedNumberOfCallsInHalfOpenState= 3
resilience4j.circuitbreaker.configs.default.automaticTransitionFromOpenToHalfOpenEnabled=true
resilience4j.circuitbreaker.configs.default.waitDurationInOpenState=5s
resilience4j.circuitbreaker.configs.default.failureRateThreshold=50
resilience4j.circuitbreaker.configs.default.eventConsumerBufferSize=10
resilience4j.circuitbreaker.configs.shared.slidingWindowSize=100
resilience4j.circuitbreaker.configs.shared.permittedNumberOfCallsInHalfOpenState=30
resilience4j.circuitbreaker.configs.shared.waitDurationInOpenState=1s
resilience4j.circuitbreaker.configs.shared.failureRateThreshold=50
resilience4j.circuitbreaker.configs.shared.eventConsumerBufferSize=10
resilience4j.circuitbreaker.instances.profile.registerHealthIndicator=true
resilience4j.circuitbreaker.instances.profile.slidingWindowSize=10
resilience4j.circuitbreaker.instances.profile.minimumNumberOfCalls=10
resilience4j.circuitbreaker.instances.profile.permittedNumberOfCallsInHalfOpenState=3
resilience4j.circuitbreaker.instances.profile.waitDurationInOpenState=5s
resilience4j.circuitbreaker.instances.profile.failureRateThreshold=50
resilience4j.circuitbreaker.instances.profile.eventConsumerBufferSize=10
resilience4j.retry.configs.default.maxAttempts=3
resilience4j.retry.configs.default.waitDuration=100
resilience4j.retry.instances.profile.baseConfig=default
resilience4j.bulkhead.configs.default.maxConcurrentCalls=30
resilience4j.bulkhead.configs.instances.profile.maxWaitDuration=10ms
resilience4j.bulkhead.configs.instances.profile.maxConcurrentCalls=20
resilience4j.thread-pool-bulkhead.configs.default.maxThreadPoolSize=4
resilience4j.thread-pool-bulkhead.configs.default.coreThreadPoolSize=2
resilience4j.thread-pool-bulkhead.configs.default.queueCapacity=2
resilience4j.thread-pool-bulkhead.instances.profile.maxThreadPoolSize=1
resilience4j.thread-pool-bulkhead.instances.profile.coreThreadPoolSize=1
resilience4j.thread-pool-bulkhead.instances.profile.queueCapacity=1
resilience4j.ratelimiter.configs.default.registerHealthIndicator=false
resilience4j.ratelimiter.configs.default.limitForPeriod=10
resilience4j.ratelimiter.configs.default.limitRefreshPeriod=1s
resilience4j.ratelimiter.configs.default.timeoutDuration=0
resilience4j.ratelimiter.configs.default.eventConsumerBufferSize=100
resilience4j.timelimiter.configs.default.cancelRunningFuture=false
resilience4j.timelimiter.configs.default.timeoutDuration=2s
resilience4j.timelimiter.instances.profile.baseConfig=default
下面是控制器API更改
private static final String PROFILE="profile";
@GetMapping("/{programType}/profile")
@AdobeIOAuthentication
@RateLimiter(name = PROFILE)
@TimeLimiter(name = PROFILE)
@CircuitBreaker(name = PROFILE)
@Bulkhead(name = PROFILE)
生成时出现错误
Error starting ApplicationContext. To display the conditions report re-run your application with 'debug' enabled.
2021-08-11 14:37:21.503 IST ERROR requestId=NA x-correlation-id=NA 17200 --- [ main] o.s.b.d.LoggingFailureAnalysisReporter :
***************************
APPLICATION FAILED TO START
***************************
Description:
An attempt was made to call a method that does not exist. The attempt was made from the following location:
io.github.resilience4j.spelresolver.autoconfigure.SpelResolverConfigurationOnMissingBean.spelResolver(SpelResolverConfigurationOnMissingBean.java:54)
The following method did not exist:
'io.github.resilience4j.spelresolver.SpelResolver io.github.resilience4j.spelresolver.configure.SpelResolverConfiguration.spelResolver(org.springframework.expression.spel.standard.SpelExpressionParser, org.springframework.core.ParameterNameDiscoverer, org.springframework.beans.factory.BeanFactory)'
The method's class, io.github.resilience4j.spelresolver.configure.SpelResolverConfiguration, is available from the following locations:
jar:file:/C:/Users/169576/.m2/repository/io/github/resilience4j/resilience4j-spring/1.6.0/resilience4j-spring-1.6.0.jar!/io/github/resilience4j/spelresolver/configure/SpelResolverConfiguration.class
The class hierarchy was loaded from the following locations:
io.github.resilience4j.spelresolver.configure.SpelResolverConfiguration: file:/C:/Users/169576/.m2/repository/io/github/resilience4j/resilience4j-spring/1.6.0/resilience4j-spring-1.6.0.jar
有人能帮我解决这个问题吗?
2条答案
按热度按时间kokeuurv1#
尝试1.7.0版
qaxu7uf22#
我遇到过这个问题。我也更新到版本1.7.0,但它不工作。我看到日志信息是显示版本参考如下:
拼写解析器配置:文件:/C:/用户/169576/. m2/存储库/io/github/弹性4j/弹性4j-Spring/1.6.0/弹性4j-Spring-1.6.0.jar
我们只需要跟踪日志,并将版本更新到1.6.0意味着日志中的版本相同