3

我有一个 Spring Boot 应用程序,但我无法利用 @EnableFeignClient,因为不支持 multipart。(请参阅我可以使用 Multipart 参数生成 Spring Feign 客户端吗?)。

我正在使用构建器创建自己的 HystrixFeign 客户端:

Request.Options options = new Options(connectTimeout, readTimeout);
MyClient client = HystrixFeign.builder()
             .client( new OkHttpClient() )
             .encoder(new FeignSpringFormEncoder())
             .decoder(new JacksonDecoder())
             .logger(new Slf4jLogger())
             .logLevel(Logger.Level.HEADERS)
             .options(options)
             .target(MyClient.class, vbApiUrl, fallback); 

如何配置 Hystrix 的其他属性?我要设置执行隔离策略,断路器睡眠窗口,音量阈值,错误阈值百分比?

将它们包含在我的 application.properties 文件中就足够了吗?如何验证这些属性是否应用于“uploadMedia”端点?

hystrix.command.uploadMedia.execution.isolation.strategy=THREAD  hystrix.command.uploadMedia.execution.isolation.thread.timeoutInMilliseconds=10000
hystrix.command.uploadMedia.execution.timeout.enabled=false
hystrix.command.uploadMedia.execution.isolation.thread.interruptOnTimeout=false
hystrix.command.uploadMedia.fallback.enabled=true
hystrix.command.uploadMedia.circuitBreaker.sleepWindowInMilliseconds=5000
hystrix.command.uploadMedia.circuitBreaker.requestVolumeThreshold=20
hystrix.command.uploadMedia.circuitBreaker.errorThresholdPercentage=50
4

0 回答 0