简体   繁体   English

用于复合API调用的Spring Cloud Gateway?

[英]Spring Cloud Gateway for composite API calls?

I am starting to build a Microservice API Gateway, and I am considering Spring Cloud to help me with the routing. 我开始构建微服务API网关,并且正在考虑使用Spring Cloud来帮助我进行路由。 But some calls to the Gateway API will need multiple requests to different services. 但是,对Gateway API的某些调用将需要对不同服务的多个请求。

Lets say I have 2 services: Order Details Service and Delivery Service . 可以说我有2个服务: 订单详细信息服务送货服务 I want to have a Gateway endpoint GET /orders/{orderId} that makes a call to Order Details service and then Delivery Service and combine the two to return full Order details with delivery. 我希望有一个网关端点GET / orders / {orderId} ,该端点先调用Order Details服务 ,然后再调用Delivery Service ,然后将两者结合起来以返回完整的订单详细信息。 Is this possible with the routing of Spring cloud or should I make these by hand using something like RestTemplate to make the calls? Spring云的路由是否可行?还是我应该使用RestTemplate之类的工具手动进行调用?

There is an enhancement proposal posted on GitHub to have routes support multiple URIs . 在GitHub上发布了一个增强建议,以使路由支持多个URI So far, there aren't any plans to implement this yet, at least, not according to one of the contributors . 到目前为止,到目前为止,还没有任何计划来实现这一目标,至少据一位贡献者说

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM