简体   繁体   English

是否可以将 map 完整的 Uris 用于不同的服务?

[英]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.

相关问题 解析不同服务中的同一实体 - Resolve Same Entity in Different Services 是否可以在突变输出处将订阅参数映射到数组? - Is it possible to map a subscription parameter to an array at the mutation output? 是否可以将 map Apollo GraphQL 响应转换为单一类型? - Is it possible to map Apollo GraphQL responses into a single type? Apollo federation 可以 2 个服务为相同的方法返回不同的模型 - Apollo federation can 2 services return different models for same method 是否可以在 object 模式中包含不同的键? - Is it possible to contain different keys in object schema? 如何 map graphQL 查询属性到不同的响应属性? - How to map graphQL query property to different response property? 将不同的排序键响应映射到Appsync模式值 - Map different Sort Key responses to Appsync Schema values vue-apollo 是否有可能从 Playground 返回不同的结果? - Is it possible for vue-apollo to return different results from the Playground? Apollo GraphQL-是否可以执行相同的查询来请求不同的字段? - Apollo GraphQL - Is it possible to do the same query requesting different fields? 带有Apollo客户端的GraphQL,是否可能具有相同的ID和不同的类型名 - GraphQL with apollo-client, Is it possible to have same id's and different typenames
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM