View the complete example here.
The Greeter service is defined as follows, including a Dubbo service with a Unary (request-response) model.
Create a build.rs
file in the project root directory (not /src) and add the following content:
After this configuration, compiling the project will generate related Dubbo Stub code, usually located at ./target/debug/build/example-greeter-<id>/out/org.apache.dubbo.sample.tri.rs
.
The dubbo.yaml file specifies the server-side configuration, including the exposed service list, protocol configuration, listening configuration, etc.
Run cargo build
to compile the server and client.
Run ./target/debug/greeter-server
to start the server, which will listen on port 8888 and provide RPC services using the triple protocol as configured in dubbo.yaml:
Run ./target/debug/greeter-client
to execute the client and call various methods under triple://127.0.0.1:8888/org.apache.dubbo.sample.tri.Greeter
:
Implement Streaming communication model using Dubbo Rust.
Implement interoperability with other Dubbo multi-language services.