Triple is an application layer's protocol based on HTTP/2, which supports interoperating with GRPC protocol naturally using Protobuf serialization. For non-protobuf applications, triple provides a compatible mode to upgrade without code modifications. So it is smooth to migrate to triple.
This sample project contains most scenarios of Dubbo and non-Dubbo interoperation.
Generate protobuf class for IDE hints.
mvn clean -DskipTests=true
org.apache.dubbo.sample.tri.stub.TriStubServer
and org.apache.dubbo.sample.tri.stub.TriStubClient
mvn clean install
to generate protobuf classes.org.apache.dubbo.sample.tri.stub.TriStubServer
org.apache.dubbo.sample.tri.stub.TriStubClient
Run org.apache.dubbo.sample.tri.pojo.TriPojoServer
and org.apache.dubbo.sample.tri.pojo.TriPojoClient
.
Dubbo3 will wrap request and response with a protobuf wrapper automatically, so it is still compatible with GRPC.
Code under test
folder is a general interoperation test suite for both Dubbo/Dubbo and Dubbo/GRPC.
org.apache.dubbo.sample.tri.TriGrpcProvider
org.apache.dubbo.sample.tri.TriClientTest
, org.apache.dubbo.sample.tri.TriPojoClientTest
and org.apache.dubbo.sample.tri.TriGenericTest
org.apache.dubbo.sample.tri.TriGrpcProvider
org.apache.dubbo.sample.tri.grpc.GrpcClientTest
org.apache.dubbo.sample.tri.grpc.GrpcServer
org.apache.dubbo.sample.tri.TriClientTest