By Apache Dubbo community
Recently, Apache Dubbo released version 3.3.0-beta.1, which is a significant branch version of 3.3. According to the community plan, 3.3 will be a vital milestone for Dubbo3. The release of 3.3.0-beta marks Dubbo3 entering a long-term stable maintenance phase, signifying that it has all the core features planned as a next-generation microservice framework for the cloud-native era.
Here are some key feature upgrades in Dubbo 3.3.0-beta.1:
• Upgrade on the Triple protocol. The upgraded protocol can run on both HTTP1 and HTTP2, is 100% compatible with gRPC, and supports direct access from cURL and browsers.
• Release of Spring Boot Starter components, including Zookeeper, Nacos, and Sentinel, which greatly simplifies dependency management during development.
• Support for RESTful annotations (such as Spring MVC and JAX-RS). With Dubbo's multi-protocol publishing mechanism, you can easily publish RPC services as standard HTTP endpoints, reducing the cost of front-end access.
• Release of Dubbo AOT (GraalVM Native Image). In specific scenarios, startup speed improves by 10 times and memory usage is reduced by 4 times.
• Upgrade on the support of JDK 21. Project Loom coroutine is supported.
• Further improvement in observability. Metrics and tracing capabilities have been enhanced.
Now, let's explore the in-depth explanations of some of these key features.
The Starter component released in Dubbo 3.3.0-beta.1 significantly simplifies application development for Spring Boot users. For example, to use the Zookeeper registry, you only need to add one dependency. You can quickly build a project by visiting the website: https://start.dubbo.apache.org
<dependency>
<groupId>org.apache.dubbo</groupId>
<artifactId>dubbo-spring-boot-starter</artifactId>
</dependency>
<dependency>
<groupId>org.apache.dubbo</groupId>
<artifactId>dubbo-zookeeper-spring-boot-starter</artifactId>
</dependency>
In addition, dubbo-curator5-zookeeper-spring-boot-starter, dubbo-nacos-spring-boot-starter, dubbo-sentinel-spring-boot-starter, dubbo-seata-spring-boot-starter, dubbo-observability-spring-boot-starter, and dubbo-tracing-otel-zipkin-spring-boot-starter are also supported.
Dubbo AOT is a static solution supported by Dubbo 3.3.0-beta. It leverages GraalVM Native Image to significantly improve the startup and running speed of Dubbo applications. You can build a project that includes GraalVM-supported files on https://start.dubbo.apache.org. Here is a summary of the results obtained from running the project in a test environment.
The startup time for a native executable file is 12 times faster than that of a JAR package. On the client side, the speed improvement is 11 times faster. This makes Dubbo AOT ideal for serverless scenarios, providing fast startup times and achieving second or even millisecond-level performance during scale-out.
After executing a native executable file, the first call is 6 times faster compared to calling a JAR package. The first call represents the prefetching duration and the time spent on parsing information, including resource information. This allows the instance to quickly reach its peak performance in serverless scenarios.
In a Dubbo application, memory usage is also reduced by approximately 3.5 times. Native executable files occupy around 60 MB of memory. On the client side, memory usage is reduced by about 4 times.
The Triple protocol is an RPC communication protocol specification designed by Dubbo3, based on HTTP. It is fully compatible with the gRPC protocol and supports communication models such as Request-Response and Streaming. It can run on both HTTP/1 and HTTP/2.
You can directly access the published Triple service using standard HTTP tools like cURL, significantly reducing the cost of testing and front-end access.
curl \
--header 'Content-Type: application/json' \
--data '{"sentence": "Hello World"}' \
http://localhost:8080/apache.dubbo.demo.example.v1.ExampleService/Say
The Dubbo framework provides implementations of the Triple protocol in multiple languages, which can help you build browsers and gRPC-compatible HTTP APIs. The Dubbo framework supports both Protobuf-first and Interface-first programming modes, that is, service definition and development modes that are not bound to IDL. For example, in Dubbo Java, you can use Java Interface and Pojo classes to define Dubbo services and publish them as microservices based on the Triple protocol.
The following is the multi-language implementation layout of the Triple protocol. Currently, browser-end Dubbo Web and back-end Dubbo Java, Dubbo Go, Dubbo Node.js, and Dubbo Rust are supported. In the future, mobile-end Dubbo and more back-end language implementations will be provided.
Based on the multi-protocol publishing capability of Dubbo, RESTful web services can be applied in many different scenarios. This allows you to publish the previous RPC service as a standard RESTful web service by adding a small amount of annotation code. Currently, Spring MVC and JAX-RS annotation modes are supported. This is helpful in many scenarios. For example, the following is a use case for a Dubbo application that is interoperable with the Dubbo system and the Spring Cloud system.
Our goal is to enable the Spring application on the left to call the Dubbo application on the right. We can use the multi-protocol publishing mechanism of Dubbo to configure multi-protocol (TCP and HTTP) publishing for some services so that this Dubbo application can serve both the Dubbo microservice system and the Spring Cloud microservice system.
To this end, we only need to add multi-protocol configuration to the original configuration:
dubbo:
protocols:
- id: rest
name: rest
port: 8090
- id: dubbo
name: dubbo
port: 20880
At the same time, the service annotation @DubboService is also configured with multi-protocol publishing:
@DubboService(protocol="rest,dubbo")
public class UserServiceImpl implements UserService {}
In this way, we can publish the UserService service with the Dubbo and REST protocols (multi-port multi-protocol mode). The Dubbo protocol serves the Dubbo system, and the REST protocol serves the Spring Cloud system.
To publish standard RESTful services, remember to add annotations to the interface. In this example, we use Spring MVC annotations.
@RestController
@RequestMapping("/users")
public interface UserService {
@GetMapping(value = "/list")
List<User> getUsers();
}
First, Metrics and Tracing are much easier to use. For Spring Boot users, only one dependency needs to be added.
Enable Metrics:
<dependency>
<groupId>org.apache.dubbo</groupId>
<artifactId>dubbo-observability-spring-boot-starter</artifactId>
</dependency>
Enable Tracing:
<dependency>
<groupId>org.apache.dubbo</groupId>
<artifactId>dubbo-tracing-otel-zipkin-spring-boot-starter</artifactId>
</dependency>
Secondly, the monitoring indicators are further enriched.
Dubbo 3.3.0-beta supports a smooth upgrade to JDK 21. At the same time, Project Loom coroutine is supported. You only need to configure setThreadPool(virtual) to enable the coroutine model.
Specifically, the following Threadpool SPI is added to the new version for implementation:
virtual=org.apache.dubbo.common.threadpool.support.loom.VirtualThreadPool
/**
* Creates a thread pool that use virtual thread
*
* @see Executors#newVirtualThreadPerTaskExecutor()
*/
public class VirtualThreadPool implements ThreadPool {
@Override
public Executor getExecutor(URL url) {
String name = url.getParameter(THREAD_NAME_KEY, (String) url.getAttribute(THREAD_NAME_KEY, DEFAULT_THREAD_NAME));
return Executors.newThreadPerTaskExecutor(
Thread.ofVirtual()
.name(name, 1)
.factory());
}
}
For Dubbo3, the community maintains three major versions: 3.1, 3.2, and 3.3. Among them, 3.2 is the recommended stable version for production. Version 3.3 is expected to replace 3.2 as the latest stable version in the coming months.
As of 3.3.0-beta.1, all the core features planned for Dubbo3 have been developed. Starting from this version, Dubbo3 will enter a phase of long-term stable maintenance. This means that no new feature plans will be introduced for future versions of Dubbo3, and the community will focus on iterating and ensuring the stability of existing features. Based on this principle, we have built a community roadmap for the next six months: https://github.com/apache/dubbo/issues/13065
Major Upgrades of Go Microservice Framework: A Preview of Apache Dubbo-go 3.2.0-alpha
508 posts | 48 followers
FollowAlibaba Cloud Native Community - July 2, 2021
Alibaba Cloud Native Community - December 20, 2024
Alibaba Developer - June 25, 2021
Alibaba Clouder - April 18, 2018
Alibaba Cloud Native Community - September 13, 2023
Alibaba Cloud Native Community - January 26, 2024
508 posts | 48 followers
FollowMSE provides a fully managed registration and configuration center, and gateway and microservices governance capabilities.
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 MoreLindorm is an elastic cloud-native database service that supports multiple data models. It is capable of processing various types of data and is compatible with multiple database engine, such as Apache HBase®, Apache Cassandra®, and OpenTSDB.
Learn MoreMore Posts by Alibaba Cloud Native Community