我正在使用Spring Webflux和Spring boot 2,我的方案是这样的。
@GetMapping(path="/products")
public List<Products> getProducts(){
return serviceObj.getProducts();
}
public List<Products> getProducts(){
List<Products> products = null;
//Call 1 -> to repository class method returning Flux<Products>
repositoryObj.getProductsFlux();
//Call 2 -> To repository class method returning List<Products>
repositoryObj.getProductsNormal();
//Concat results from Call 1 & Call 2 and return List<Products>
return products;
}
如何在返回之前将Flux & normal产品列表中的结果连接起来呢?
P.S.我不想调用.block()和CompleteableFuture来处理从Call 1得到的结果。