apache / apache/servicecomb-java-chassis
Edge Service作为网关和其他常见网关的差异
- Dominant language
- Java
- Stars
- 1.9k
- Forks
- 814
- Avg merge
- 8d 23h
- Merged PRs (30d)
- 1
Description
Edge Service是 servicecomb 提供的一个微服务网关, 他的主要功能是将请求转发到 java chassis开发的微服务。 虽然主要功能也是请求转发,但是和其他网关,比如 Zuul, Spring Cloud Gateway在功能设计上存在很多差异。 这里主要描述其差异。
# 转发的协议
Edge Service可以将用户的HTTP请求转发到java chassis开发的微服务,不管java chassis开发的微服务是什么协议,比如 REST、Highway等,都可以转发。 Edge Service会自动基于swagger信息进行协议转换。
# 转发的内容和原始请求的关系
Edge Service不会将原始请求直接转发给后台服务,这个是和其他网关不一样的。 如果后台微服务是一个REST微服务,用户通过HTTP请求传递了很多的头、query参数、body参数等, Edge Service会根据swagger解析消息,只传递后台微服务在swagger声明的头、query参数、body参数等, swagger 未声明的信息会被丢弃。 因此经过edge service转发的HTTP信息,是被重新修改的信息,应用程序不能假设这些信息和用户传递的原始信息是完全相同的。
在需要传递swagger声明之外信息的时候,需要在Edge Service配置映射或者自定义Filter,将信息放到InvocationContext里面传递,后台服务可以[通过 InvocationContext 获取](https://servicecomb.apache.org/references/java-chassis/zh_CN/general-development/context.html) 。
>>> 点击查看 [和 Edge Service 有关的问题](https://github.com/apache/servicecomb-java-chassis/issues?q=is%3Aopen+is%3Aissue+label%3Aedge)
Contributor guide
No contributing guide indexed for this repository
Research direction
Use the issue’s sections on forwarding protocols and the relationship between forwarded content and the original request as the outline. Review the linked InvocationContext reference and related Edge Service issues for context. Done means documenting the differences from Zuul and Spring Cloud Gateway, including how to pass undeclared information.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- documentation
- Issue type
- Documentation
- Difficulty
- 2/5
- Estimated time
- Half a day
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 52/100