當(dāng)前位置:
首頁 >
openFeign异步调用问题
發(fā)布時(shí)間:2024/3/24
32
豆豆
生活随笔
收集整理的這篇文章主要介紹了
openFeign异步调用问题
小編覺得挺不錯(cuò)的,現(xiàn)在分享給大家,幫大家做個(gè)參考.
報(bào)錯(cuò)信息
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
還原場(chǎng)景
網(wǎng)關(guān)服務(wù)通過openfeign調(diào)用授權(quán)服務(wù)
授權(quán)服務(wù)
@GetMapping("/get")public String openFeignApi(){return "asdgwe";}網(wǎng)關(guān)服務(wù)
@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();}此時(shí)請(qǐng)求網(wǎng)關(guān)的/get就會(huì)報(bào)上面的錯(cuò)誤。
需要添加一些配置
總結(jié)
以上是生活随笔為你收集整理的openFeign异步调用问题的全部?jī)?nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 《Dolby Vision White
- 下一篇: 软件测试----性能测试