Webflux在使用httpclient调用时获得异步响应



这里可以提供异步非阻塞httpclient方法吗?在返回响应后,将根据requestID通知请求者,而不是在网络IO等待时阻塞线程。

Mono blockingWrapper = Mono.fromCallable(() -> { 
return /* make a remote synchronous call */ 
});
blockingWrapper = blockingWrapper.subscribeOn(Schedulers.boundedElastic()); 

我试过上面的方法,但似乎不起作用。使用SpringCloudGateway代理http服务器时,tps仍然很低。

Mono blockingWrapper = Mono.fromCallable(() -> { 
return /* make a remote synchronous call */ 
});
blockingWrapper = blockingWrapper.subscribeOn(Schedulers.boundedElastic()); 

我试过上面的方法,但似乎不起作用。使用SpringCloudGateway代理http服务器时,tps仍然很低。

最新更新