By Dubbo Community
We are thrilled to announce the official release of Dubbo 3.2! This version introduces many new features and improvements and represents a significant step towards the cloud nativeization of Dubbo.
Apache Dubbo is an RPC service development framework that solves service governance and communication issues in microservice architecture. Dubbo officially provides multi-language SDK implementations such as Java and Golang. Microservices developed using Dubbo can easily communicate with one another through remote address discovery. Dubbo offers extensive service governance features that enable service discovery, load balancing, and traffic scheduling. Dubbo is highly scalable, and users can implement custom logic for traffic interception and location selection.
With the rise of mobile internet, more and more applications need to integrate with different systems that may use different communication protocols. This requires applications to be flexible enough to adapt to various protocols. The Rest protocol is a highly flexible protocol that uses HTTP for communication and can easily integrate with almost any system.
In the past, RPC frameworks used binary protocols for communication, which were highly efficient but lacked flexibility. In contrast, the Rest protocol uses HTTP for communication, making it easier to integrate with other systems, modern web, and mobile applications.
Apart from flexibility, the Rest protocol is easy to read and use. Developers can test and debug services with generic HTTP tools such as cURL and Postman, without the need for specific tools. Additionally, because Rest protocol uses standard HTTP methods such as GET, POST, PUT, and DELETE, developers can easily understand and use the service.
In previous Dubbo versions, the Rest protocol was supported, but it came with some issues:
• Only JAX-RS annotations were supported, which are more complex than the widely adopted Spring Web annotations.
• It required several external components such as Resteasy, Tomcat, and Jetty to function properly, increasing the cost of usage.
To address these issues, Dubbo 3.2 introduces support for Spring Web annotations and native Rest protocol support without relying on any external components.
The most significant difference is that services published through Spring Web can be directly published through Dubbo by simply replacing the @Controller annotation with the @DubboService annotation when upgrading to Dubbo 3.2.
Furthermore, with this feature, users who partition microservices using Spring Boot or Spring Cloud can smoothly migrate to Dubbo at a low cost to leverage Dubbo's powerful capabilities.
Dubbo strives to continuously improve to better meet the evolving needs of our users. In addition to the existing features, we are excited to announce the addition of the following new features:
In a microservices architecture, a business system is composed of multiple services that interact with each other. The challenge that arises is how to quickly identify and resolve faults in a timely manner. To address this challenge, we need tools and technologies that ensure the reliability of the entire system. One solution is to utilize log recording and analysis to track application performance, identify potential issues, and resolve them promptly. Additionally, visual monitoring tools help us understand the state of the entire system, enabling us to predict and address problems more effectively. Finally, automated testing ensures the quality of each service, enhancing the stability and reliability of the entire system, ultimately better meeting customer needs.
A complete observability system should include the following functions:
• Metrics for collecting and analyzing system performance and resource consumption, enabling users to stay informed about the system's operation and identify and address exceptions.
• Tracing to trace call chains between services in the system, providing insights into operation, identifying potential performance problems and bottlenecks, and facilitating effective optimization and adjustments.
• Logging to record various events and operations in the system, including error logs, access logs, and transaction logs, enabling users to understand system operation and fault information, locate problems quickly, and take appropriate actions.
In summary, these three functions help users quickly locate faults, improve system reliability and stability, and gain deep insight into system operation and performance.
Dubbo 3.2 has enhanced both Metrics and Tracing to better support these functions.
In terms of Metrics, we have greatly improved event tracking using Micrometer, which includes core service metrics such as QPS, RT, total number of calls, and success/failure rates, as well as failure cause statistics. To better monitor service operation, Dubbo offers monitoring of core component statuses, such as thread pool numbers and service health status. Moreover, Dubbo supports the Pull and Push modes of standard Prometheus and provides multiple official native Grafana panels, enabling round-the-clock observation of production-oriented Metrics.
For all users, you only need to upgrade to Dubbo 3.2 and add the dubbo-spring-boot-observability-starter dependency to obtain the Metrics capability. After the application is started, relevant metrics are exposed under the metrics command of Dubbo QoS. You can obtain the metrics locally at http://127.0.0.1:22222/metrics
. In addition, for users who use Spring Actuator, Dubbo automatically exposes this data.
In terms of Tracing, we have implemented event tracking of request runtime using Micrometer and realized this function natively through the Filter interceptor. We support exporting trace data to mainstream implementations such as Zipkin, Skywalking, and Jaeger, enabling the analysis and visualization of trace data for a comprehensive process.
In terms of Logging, Dubbo introduced an error code mechanism since version 3.1, achieving full coverage of WARN- and ERROR-level logs. In abnormal scenarios, the solution documents on the official website can be quickly indexed.
In terms of Native Image, Dubbo will officially support Native Image based on GraalVM from version 3.2. Although Dubbo had explored some support for Native Image since version 3.0, the support was inefficient and had low ease of use. Starting from version 3.2, Dubbo has simplified the way users access Native Image, mainly through the following three aspects:
In addition to improved ease of use, Dubbo will support API, annotation, and XML configuration methods in native image scenarios in version 3.2 and ensure native compatibility with Spring Boot 3.
JDK 17 is the latest LTS release of Java following JDK 11, and it offers many new features and improvements, such as enhanced Sealed classes and garbage collector.
Since JDK 16 began restricting inner classes with Java reflection, Dubbo's serialization and dynamic proxy functionality have been affected to some extent. However, in Dubbo 3.2, we addressed this issue by optimizing Fastjson2 and Javassist from the bottom layer, enabling Dubbo to run seamlessly on JDK 17. Currently, all unit tests and most integration tests have passed on the JDK 17 platform.
Looking ahead, Dubbo is actively preparing to adapt to JDK 21 LTS and support Dubbo coroutine, Project Loom in Dubbo 3.3.
In version 3.2, we have fine-tuned the RPC call performance in several ways:
Compared to version 3.1, version 3.2 demonstrates the following performance improvements:
• Triple protocol: In smaller message scenarios like createUser, existUser, and getUser, the improvement rate is approximately 40-45% - equivalent to that of the same gRPC scenario. In the larger message scenario listUser, the improvement rate is about 17%, which is 11% lower than the same gRPC scenario.
• Dubbo protocol: In smaller message scenarios like createUser and existUser, the improvement rate is about 180%. In the minimum message scenario existUser (only a boolean value), the improvement rate is about 24%. In the largest message scenario listUser, the improvement rate is the highest, reaching 1000%!
<dependency>
<groupId>org.apache.dubbo</groupId>
<artifactId>dubbo</artifactId>
<version>3.2.0</version>
</dependency>
For most users, upgrading to Dubbo 3.2.0 is smooth, and only the dependency package version needs to be modified.
In Dubbo 3.2.0, we have enabled strong validation of serialization whitelists by default to improve Dubbo security and prevent remote command execution. The current mechanism trusts partial classes automatically through the package name recursion mechanism. However, for users who utilize generics resulting in incomplete scanning, we recommend adding the -Ddubbo.application.serialize-check-status=WARN configuration. After observing the logs and QoS commands for a certain period, if no security alerts are triggered, you can configure the strong verification mode.
For more information on how to configure a custom whitelist, please refer to the official website's "Documentation/SDK manual/Java SDK/Advanced features and usage/Improve security/Class check mechanism".
Dubbo 3.2.0 begins to switch the default serialization mode from Hessian2 to Fastjson2. For applications upgraded to 3.2.0, Dubbo will automatically use Fastjson2 for serialization. Please note that as long as one client or server side has not been upgraded to version 3.2.0, both sides will be downgraded to use Hessian2 for serialization to ensure compatibility.
Push empty protection is intended to maintain the last batch of provider information to ensure service availability when the registry fails and actively pushes empty addresses. However, in most cases, the registry will not push empty addresses even if it fails, which only occurs in some special cases. Enabling push empty protection will greatly affect the fallback logic and heartbeat logic of Dubbo, making it difficult for developers to use Dubbo.
If you want to enable push empty protection for high availability in the production environment, you can set the dubbo.application.enable-empty-protection parameter to true. However, please note that enabling empty push protection will make server applications fail to roll back to the original version when upgrading from version 2.6.x and 2.7.x, which only support interface-level service discovery, to version 3.x. In extreme cases, service calls may fail.
Dubbo 3.2 is an essential update, introducing a host of new features and improvements that enhance Dubbo's power and ease of use. We are thankful for the support and contributions of our community, and we encourage everyone to experience Dubbo 3.2 as soon as possible and enjoy its convenience and benefits.
Building a Streaming Data Processing Platform Based on RocketMQ Connect
Dubbo Initializer: Simplifying Project Initialization and Dependency Management
506 posts | 48 followers
Followkirito.moe - April 14, 2020
Alibaba Cloud Native Community - January 26, 2024
Alibaba Cloud Native - October 9, 2021
Alibaba Developer - February 4, 2021
Alibaba Cloud Native Community - September 12, 2023
Aliware - October 20, 2020
506 posts | 48 followers
FollowMSE provides a fully managed registration and configuration center, and gateway and microservices governance capabilities.
Learn MoreMulti-source metrics are aggregated to monitor the status of your business and services in real time.
Learn MoreAccelerate and secure the development, deployment, and management of containerized applications cost-effectively.
Learn MoreAlibaba Cloud Function Compute is a fully-managed event-driven compute service. It allows you to focus on writing and uploading code without the need to manage infrastructure such as servers.
Learn MoreMore Posts by Alibaba Cloud Native Community