我正在使用 Spring 云平台开发微服务,其中 service1 调用多个其他微服务,例如service2、service3、service 4 等。这些服务可以并行调用,service1 将聚合结果。我可以使用 Spring cloud feign ( http://cloud.spring.io/spring-cloud-static/Dalston.SR1/#spring-cloud-feign ) 生成 REST 客户端并异步调用服务,还是应该使用 Spring 4 AsyncRestTemplate 异步调用服务?
最佳答案
我已经使用 CompletableFuture 使用 feign 客户端将异步调用链接到多个微服务,但最终并未成功。请通过以下链接了解更多信息。我的理解是 - Feign 不是为异步调用或零拷贝 i/o 设计的。
关于Spring Cloud Feign 非阻塞 I/O 或异步调用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44509028/