openFeign异步调用问题
生活随笔
收集整理的這篇文章主要介紹了
openFeign异步调用问题
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
報錯信息
java.lang.IllegalStateException: block()/blockFirst()/blockLast() are blocking, which is not supported in thread reactor-http-nio-3at reactor.core.publisher.BlockingSingleSubscriber.blockingGet(BlockingSingleSubscriber.java:83) ~[reactor-core-3.4.15.jar:3.4.15]Suppressed: reactor.core.publisher.FluxOnAssembly$OnAssemblyException: Error has been observed at the following site(s):*__checkpoint ? org.springframework.cloud.gateway.filter.WeightCalculatorWebFilter [DefaultWebFilterChain]*__checkpoint ? HTTP GET "/get" [ExceptionHandlingWebHandler]版本:
springcloud alibaba 2021.0.1.0
springboot 2.7.0
gateway 3.1.1
openfeign 3.1.1
還原場景
網關服務通過openfeign調用授權服務
授權服務
@GetMapping("/get")public String openFeignApi(){return "asdgwe";}網關服務
@SpringBootApplication @EnableDiscoveryClient @EnableFeignClients public class GatewayServerApplication {public static void main(String[] args) {SpringApplication.run(GatewayServerApplication.class, args);}} @Component @FeignClient(value = "oauth") public interface OauthFeign {@GetMapping("/get")String openFeignApi(); }controller
@ResourceOauthFeign oauthFeign;@GetMapping("/get")public Object get() {return oauthFeign.openFeignApi();}此時請求網關的/get就會報上面的錯誤。
需要添加一些配置
總結
以上是生活随笔為你收集整理的openFeign异步调用问题的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 《Dolby Vision White
- 下一篇: 软件测试----性能测试