This example shows the basic usage of Triple protocol with a typical request-response model demo that uses IDL as the method of defining Dubbo service.
As described in the Triple protocol documentation, Dubbo triple protocol is a better gRPC implementation which can be accessed by cURL and web browsers directly.
More usages of Triple protocol can be found here:
Detailed explanation of this demo can be found here.
Make sure you are in dubbo-samples-triple-unary
before running the following commands.
mvn clean compile #Compile and generate code
$ mvn compile exec:java -Dexec.mainClass="org.apache.dubbo.samples.tri.unary.TriUnaryServer"
There are two ways to test the server works as expected:
curl \ --header "Content-Type: application/json" \ --data '{"name": "Dubbo"}' \ http://localhost:50052/org.apache.dubbo.samples.tri.unary.Greeter/greet/
$ mvn compile exec:java -Dexec.mainClass="org.apache.dubbo.samples.tri.unary.TriUnaryClient"