Dubbo-go-pixiu is a high-performance API gateway that supports multiple protocols such as Dubbo and Http. For specific introduction articles, please refer to "Dubbo Cross-language Calling Mythical Beast: dubbo-go-pixiu" .
Recently, the community released version 0.4.0, please check v0.4.0 for details. There are too many related improvements. This article only lists related major features, bugfixes, and performance improvements.
1 Dynamically pull routing and cluster configuration data from Spring Cloud and Dubbo registry
Pixiu originally relied on local configuration files to read routing and upstream cluster configuration data, which was very inconvenient for real production scenarios. Therefore, Pixiu needs to support the function of dynamically obtaining routing and cluster configuration data from the cluster registry.
As shown in the figure above, services A, B, and C perform service registration and store their own metadata in the registry. Pixiu pulls the registered service metadata from the registry, builds its own routing rules and forwarding cluster configuration. When the client sends a request, Pixiu will forward the request to the corresponding back-end service based on the constructed forwarding rules.
solutions Spring Cloud and Dubbo respectively. The related pr is 161d3dbe965456 https://github.com/apache/dubbo-go-pixiu/pull/255 and https://github.com/apache/dubbo-go-pixiu/pull/256
Currently, this feature only supports pulling metadata from zk and nacos, and more support for service registration centers is underway. Interested students are welcome to participate, and you can join the DingTalk group 31203920.
2 Support the conversion of Http protocol to gRPC protocol
The gRPC protocol is already a de facto cloud-native basic communication protocol. A large number of cloud-native middlewares such as etcd, istio, dapr provide gRPC-related API interfaces for external use. Dubbogo 3.0 also builds a fully compatible gRPC triple protocol based on gRPC.
But for external systems, traditional HTTP requests are still the simplest and most stable means of communication, so Pixiu provides the ability to convert Http protocol requests to gRPC protocol requests, which facilitates the external exposure of the gRPC API of internal services in the form of Http. The specific mode is shown in the figure below. Pixiu is responsible for decoding the client's Http request, encoding it into a gRPC request, and forwarding it to the back-end service.
At present, Pixiu is encoding and decoding related protocols based on the locally configured proto file. The specific pr is https://github.com/apache/dubbo-go-pixiu/pull/244. The next stage will gRPC, reducing the configuration work at the gateway.
3 Support jaeger standard link propagation protocol
Observability is one of the important quality indicators of large software systems, and distributed link tracking is the top priority among them.
Pixiu builds a distributed link tracking system based on the opentelemetry specification, and supports uploading data to jaeger for recording and display. Pixiu will also pass Span-related information to the upstream service, so that developers can see the complete processing link of each network request forwarded by Pixiu, which is convenient for users to track links and troubleshoot online problems.
OpenTelemetry combines the OpenTracing and OpenCensus projects and provides a set of APIs and libraries to standardize the collection and transmission of telemetry data. Using this specification, it can be easily switched between different distributed link tracking data storage terminals. Currently Pixiu supports uploading data to jaeger, which can be extended later to support different types of TracerProvider.
The effect diagram of tracking using Jaeger is shown below.
The specific pr is https://github.com/apache/dubbo-go-pixiu/pull/236
4 Support cors strategy
Pixiu supports cross-domain resource sharing strategy, the specific pr is https://github.com/apache/dubbo-go-pixiu/pull/249
5 Support HTTPS security encryption
Pixiu supports HTTPS security encryption, the specific pr is https://github.com/apache/dubbo-go-pixiu/pull/213
6 Added more case projects
More case projects have been added under the samples folder of the Pixiu project, including but not limited to:
Service discovery case of spring cloud and Dubbo cluster, the path is samples/springcloud and samples/dubbogo/simple/registry;
Distributed link tracking case, the path is samples/dubbo/simple/jaeger;
For the http to grpc case, the path is samples/http/grpc/.
7 docker example
At present, the Pixiu community has developed a docker image to facilitate your testing. The zookeeper and nacos registration centers that currently support dubbo services, configure the registration center (your own dubbo service registration center address) address of the specified environment variables to use:
docker pull phial3/dubbo-go-pixiu:0.0.1
docker run --name you-pixiu-name -e DUBBO_REGISTRY_ADDRESS=zookeeper://10.170.224.25:2181 phial3/dubbo-go-pixiu:0.0.1
docker run --name you-pixiu-name -e DUBBO_REGISTRY_ADDRESS=nacos://10.170.224.25:8848 phial3/dubbo-go-pixiu:0.0.1
If you have any questions, welcome to join the dubbogo community group [Dingding search group number 23331795 or Dingding scan the QR code of the following group]
Author: Zhang Tian, from Shandong, graduated from Nanjing University in 2018. Currently working for a local startup company in Nanjing.
**粗体** _斜体_ [链接](http://example.com) `代码` - 列表 > 引用
。你还可以使用@
来通知其他用户。