tree: 8fd3aac1115eb302ea488a1c62ce6c7dc79e0a25 [path history] [tgz]
  1. src/
  2. case-configuration.yml
  3. case-versions.conf
  4. pom.xml
  5. README.md
1-basic/dubbo-samples-api/README.md

About this sample

This example demonstrates building up of Dubbo rpc server and client with lightweight API. The API is quite simple and straightforward.

Follow steps below to run this example.

Start Server

Run the command below to start the Dubbo rpc server

mvn clean package
mvn -Dexec.mainClass=org.apache.dubbo.samples.provider.Application exec:java

Now, you have a server running on port 50052 which accepts triple protocol requests.

More usages of triple protocol can be found here:

Start Client

There are two ways to test the server works as expected:

  • Standard HTTP tools like cURL.
  • Dubbo sdk client.

cURL

curl \
    --header "Content-Type: application/json" \
    --data '["Dubbo"]' \
    http://localhost:50052/org.apache.dubbo.samples.api.GreetingsService/sayHi/

SDK client

mvn -Dexec.mainClass=org.apache.dubbo.samples.client.Application exec:java