[英]Is it possible to map full Uris to different services?
I want to create multiple GraphQL microservices which can be independently deployed to AKS, then utilize a GraphQL Federated gateway to expose a composite graph.我想创建多个可以独立部署到 AKS 的 GraphQL 微服务,然后使用 GraphQL 联合网关来公开复合图。 I'm wondering if it's possible to go beyond subdomains for separating out the URIs that match.我想知道是否可以将 go 超出子域以分离出匹配的 URI。
https://graph.xyzcorp.com/ -- GraphQL Gateway
https://graph.xyzcorp.com/{Microservice Name} -- GraphQL Microservice
I really don't want to have to use multiple subdomains or different subdomain names such as https://customer.graph.xyzcorp.com/
, https://customergraph.xyzcorp.com/
, etc. I also don't want to combine all the microservices into a single project as that would create a monolith again.我真的不想使用多个子域或不同的子域名,例如https://customer.graph.xyzcorp.com/
、 https://customergraph.xyzcorp.com/
等。我也不想要将所有微服务组合到一个项目中,因为这将再次创建一个整体。
What you have currently is the correct implementation.您目前拥有的是正确的实现。 You have the gateway and all microservices are mapped(registered) to the gateway.您拥有网关,并且所有微服务都映射(注册)到网关。
Just mapping all the microservices to gateway is not going to make your application monolithic because gateway is just the entry point of your application.仅将所有微服务映射到网关不会使您的应用程序变得单一,因为网关只是应用程序的入口点。
I would suggest while defining the contract of microservices(may be swagger), you can mention the base path and path of endpoint like below.我建议在定义微服务合同时(可能是大摇大摆的),您可以像下面这样提及端点的基本路径和路径。
basepath:: domainName/version1.0基本路径:: 域名/version1.0
Hope this may help you.希望这可以帮助你。
path::microserviceName/customer/{id}路径::微服务名称/客户/{id}
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.