A lightweight, generated-client Dubbo consumer library for Rust-Java REST services.
Call Dubbo providers from Java 21 REST handlers with a Rust native TCP transport — without pulling Apache Dubbo, Netty, Spring Boot, or ZooKeeper into your process.
- Compile-time client generation: Declare typed Dubbo clients with
@NativeDubboClient; no dynamic proxies or reflection on the hot path. - Native Rust transport: Connection pooling, heartbeats, deadlines, and backpressure run in Rust over JNI (Dubbo ABI
7). - Kubernetes-friendly static discovery: Point directly at a Kubernetes Service DNS name or static
host:portlist without ZooKeeper (ZooKeeper remains available as an opt-in). - Two transport modes:
blockingfor ultra-low RSS single-core pods, andtokio-demuxfor multiplexed high-concurrency async RPCs. - Native JSON response handles: Forward provider JSON bytes straight to HTTP via
DubboResponses.replyAsync(...)without allocating intermediate Java arrays.
Recommended with rust-java-platform-parent (4.11.0):
<dependency>
<groupId>com.reactor</groupId>
<artifactId>rust-java-starter-dubbo</artifactId>
</dependency>Or add java-rust-dubbo directly:
<dependency>
<groupId>com.reactor</groupId>
<artifactId>java-rust-dubbo</artifactId>
<version>0.11.0</version>
</dependency>@NativeDubboClient(
service = CustomerQueryService.class,
version = "1.0.0"
)
public interface CustomerClients {}reactor.runtime.profile=micro-dubbo
reactor.dubbo.transport=native
reactor.dubbo.providers=customer-provider.default.svc.cluster.local:20880
reactor.dubbo.timeout-ms=1000
reactor.dubbo.retries=0@RestController
public final class CustomerHandler {
private final CustomerQueryServiceClient client;
public CustomerHandler(CustomerQueryServiceClient client) {
this.client = client;
}
@GetMapping("/api/customers/{id}")
public CompletionStage<CustomerSummary> find(@PathVariable("id") long id) {
return client.findByIdAsync(id);
}
}| Profile / Transport | Best For | Connections / Endpoint | Async Workers | Max In-Flight |
|---|---|---|---|---|
micro-dubbo + blocking |
1 CPU / 128 MiB pods, minimal RSS |
1 |
1 |
32 |
low-rss + blocking |
Small 2 CPU services |
2 |
2 |
64 |
balanced-dubbo + tokio-demux |
Multi-core high-concurrency async RPCs | 16 |
8 |
512 |
throughput + tokio-demux |
Peak throughput on 4+ CPU hosts |
32 |
16 |
1024 |
reactor.runtime.profile=micro-dubbo
reactor.dubbo.transport=native
reactor.dubbo.native-async-transport=blocking
reactor.dubbo.providers=provider-svc:20880
reactor.dubbo.native-connections-per-endpoint=1
reactor.dubbo.native-async-workers=1
reactor.dubbo.max-inflight=32
reactor.dubbo.timeout-ms=800
reactor.dubbo.retries=0reactor.runtime.profile=balanced-dubbo
reactor.dubbo.transport=native
reactor.dubbo.native-async-transport=tokio-demux
reactor.dubbo.providers=provider-svc:20880
reactor.dubbo.native-connections-per-endpoint=4
reactor.dubbo.native-async-workers=4
reactor.dubbo.native-async-queue-capacity=512
reactor.dubbo.max-inflight=256
reactor.dubbo.timeout-ms=1200Async tip: Keep
CompletionStagecontinuations short and non-blocking. Never call.join()or.get()inside a completion callback — offload blocking work to a dedicated application executor.
reactor.dubbo.transport=native
reactor.dubbo.registry-address=zookeeper://zk-1:2181,zk-2:2181
reactor.dubbo.registry-root=dubbo
reactor.dubbo.registry-check=false- Operations Guide · Production Guide · Release Notes (v0.11.0)
- Live Samples: rest-sample-dubbo-consumer · rest-sample-dubbo-provider
- Using Spring Boot 3? See java-rust-dubbo-spring-boot.