知识卡片
网关按请求属性路由
网关可依据路径、请求头和接口版本把请求交给不同服务。路径表达业务资源,版本等属性表达请求所属契约;规则变化让后端演进对客户端更透明,也要求避免错误配置把请求发送给无权访问的服务。
这张卡片看不懂?
这张卡片已通过人工审查,不再接受失败反馈。
已有反馈 · 0 条
还没有人提交反馈。
在整书笔记中的位置
原书出处 · 1 处
- Architecture of Distributed Systems · 查看原书依据
Modern API Gateways offer fine-grained routing control through multiple mechanisms. Path-based routing allows directing traffic based on URL patterns requests to /api/orders/ might route to the OrderProcessingService, while /api/products/ routes to ProductCatalogService. Header-based routing enables even more sophisticated patterns, such as routing requests with specific API versions (via custom-version header) to different service implementations, or directing traffic based on user demographics stored in authorization headers.
参考来源
- 位置:《Building Distributed Systems Designing scalable architectures with microservices, event-driven patterns, and robust deployment…》第03章《Architecture of Distributed Systems》(来源项目:a19c7933-4eda-4176-aebd-30fe7e1ad292;源文件:extracted/Building Distributed Systems Designing scalable architectures with microservices, event-driven patterns, and robust deployment…/_epub-src/OPS/ch03.xhtml)
- 结论依据:原文给出本卡对象的职责及相关使用情境,本卡保留相应边界,不将具体产品功能或概述推广为无条件保证。
- 原始内容:Modern API Gateways offer fine-grained routing control through multiple mechanisms. Path-based routing allows directing traffic based on URL patterns requests to /api/orders/ might route to the OrderProcessingService, while /api/products/ routes to ProductCatalogService. Header-based routing enables even more sophisticated patterns, such as routing requests with specific API versions (via custom-version header) to different service implementations, or directing traffic based on user demographics stored in authorization headers.