The author | citizen dubbo – go community 4-8
The Dubbogo community recently released Dubbogo V1.5.6. This version is aligned with Dubbo 2.7.8, provides command-line tools, and provides multiple ways to load configurations.
There are so many related improvements that this article only lists relevant major features and performance improvements.
1. Command line tool
Those familiar with Dubbo may know that dubbo supports Telnet command-line online debugging.
Dubbo-go’s CLI command line tool is added in this release, which enables users to directly connect to specific services, define transmission structure and data by writing JSON files, initiate calls for online debugging, and print returned data and time consumption.
Nested structs are currently supported, but only request packets and return packets for a single parameter are supported. Data types Only golang basic data types are supported: string, integer, and floating point because they need to be defined in JSON.
The community will post a follow-up article on how this works and how it works. The associated PR is github.com/apache/dubb… Implemented by the youngest apache Committer of Dubbogo, Li Zhixin.
2. Proxy implementation extension
Refactoring the Proxy and adding the ImplementFunc function to allow the project to reimplement the Proxy for the Proxy. If ProxyFactory is used for custom registration, the created proxy. proxy can also customize the implementation and modify the returned data.
The main application scenario is in the gateway generalization call scenario. Those who know will understand.
Related github.com/apache/dubb pr… Written by the author himself.
3. Specify the path of the configuration file during startup
Users using previous versions of Dubbogo joked that it only provided environment variables to load specified configuration files.
export CONF_PROVIDER_FILE_PATH=”.. /profiles/dev/server.yml” export CONF_CONSUMER_FILE_PATH=”.. /profiles/dev/server.yml” export APP_LOG_CONF_FILE=”.. /profiles/dev/log.yml”
V1.5.6 provides a new interface for loading configuration files: On the startup command line, set the path of the configuration file using three flags: proConf, conConf, and logConf.
Service Provider:
go run . -proConf .. /profiles/dev/server.yml -logConf .. /profiles/dev/log.yml
Service Consumer:
go run . -conConf .. /profiles/dev/client.yml -logConf .. /profiles/dev/log.yml
Related github.com/apache/dubb pr… It was realized by Chen Jiapeng, a junior at Nanjing University of Information Science and Technology.
4. Customize ServerConfig and ReferenceConfig
The ConfigPostProcessor interface is added. You can use this interface to provide two methods for loading customized configurations when deploying the Dubbogo service.
/ / the provider configuration PostProcessServiceConfig (* common URL) / / service consumer configuration PostProcessReferenceConfig (* common URL)
Related github.com/apache/dubb pr… It is realized by Dubbo Chairman Beiwei, who is approaching 50. Chairman is old and healthy, and calls on everyone to learn from Chairman.
5. Expand URL comparisons
CompareURLEqualFunc is provided in common/url.go, which allows users to customize URL comparison to improve comparison efficiency. See the links below for technical details.
Common/url. Go: github.com/apache/dubb…
The current URL implementation is not in a final state. The common.URL will be split into ServiceConfigURL, ServiceAddressURL, and InstanceAddressURL in a future version of Dubbogo 3.x. Map schemas for the configuration center, registry, and metadata center to minimize change pressure to the lowest granularity.
This function corresponds to pr github.com/apache/dubb… By Ali Double eleven middleware team leader Zhantu students to achieve. Students have been working hard on the programming front line.
Registry optimization
Reuse of ZooKeeper links and optimization of service discovery center logic, greatly reduce the number of TCP links with ZooKeeper, reduce the number of goroutine, reduce the memory usage of Dubbo-Go.
We will reuse the same logic across registries such as NACOS, ETCD, Consul, reducing the number of Goroutines in the registry and reducing consumer and provider memory usage.
This function corresponds to pr github.com/apache/dubb… Now by ant middleware work wang Wenxue students in graffiti work to achieve.
7. Perform the configuration in API format
Previous versions of Dubbogo only provided the option to read configuration from a configuration file. This feature added the configuration as an API, and users could call the relevant API to initialize the configuration.
You can use the API to set related parameters without loading configuration files.
For example: github.com/apache/dubb…
Related github.com/apache/dubb pr… It was also realized by Li Zhixin.
8. GRPC optimization
Enable the consumer Config timeout in Dubo-go connect_timeout and gRPC server timeout. You can customize the gRPC timeout mechanism.
connect timeout
connect_timeout: “3s”
application config
application: organization: “dubbo.io” name: “GreeterGrpcConsumer” module: “dubbo-go greeter grpc client” version: “0.0.1 environment” : “dev”
Change the mechanism for processing registry service change events to synchronization to prevent errors in the processing sequence of online and offline events caused by frequent service restarts on the Provider end.
When the gRPC protocol is used, gRPC services corresponding to all Dubbo-Go services are registered with the gRPC Server and started only after all dubbo-Go services are exposed asynchronously. This fixes the problem that only one service can be registered on the provider.
Overall features from github.com/apache/dubb… Ke Zhan, an engineer from Shanghai Shizhuang Information Technology Co., LTD. (the company where famous APP is located), Yu Yu, the head of DubboGo community, Yun Xing, an engineer from Ali, and Zhang Tian, a student from a company In Nanjing, are jointly responsible for the implementation.
9. Hessian2 go latest feature
In addition to the improvements to Dubo-Go itself, the latest version of the Dubo-Go-Hessian 2 project to date, v1.9.2, also includes the following major improvements:
Built-in support for Java.util.locale:
Github.com/apache/dubb…
Built-in support for java.util.UUID:
Github.com/apache/dubb…
Support encoding no POJO object:
Github.com/apache/dubb…
Built-in support for java.sql.Time:
Github.com/apache/dubb…
Built-in support for java.sql.Date:
Github.com/apache/dubb…
Dubbo – go – hessian2:
Github.com/apache/dubb…
The overall PR was completed by wang Ge, Li Zhixin, Zhang Yanming and other students in charge of Dubo-Go-Hessian 2 project.
10. Retrospectives and prospects
Dubbogo is currently in a stable and mature state, and version 1.5 will be maintained continuously for BUG fixes and minimal optimizations as necessary.
More information: github.com/apache/dubb…
The latest cloud-native version 3.0 is based on V1.5. x and will be backward compatible with V2.7. x as well as Dubbo 3.0, with the first release scheduled for late April.
If you have any questions, welcome to join the communication group [Nail Group No. 31363295] :
Author’s brief introduction
Github ID CityIron, Committer of Dubbo-Go community, mainly involved in dubbo-Go version 1.5 iteration, Dubbo-Go 3.0 service routing and cloud native, and principal of Dubbo-Go-Pixiu project. Currently, I am working in Ali Hema Business Group, engaged in transaction process work. I am good at using Java/Go language, and focus on cloud native and micro services and other technical directions.Copy the code
Log in to start.aliyun.com for immersive online interactive tutorials.