tree: 4954d7e23a12183dfe9a249a7953d2b104fabfae [path history] [tgz]
  1. src/
  2. case-configuration.yml
  3. case-versions.conf
  4. pom.xml
  5. README.md
2-advanced/dubbo-samples-triple-rest/dubbo-samples-triple-rest-jaxrs/README.md

Dubbo Triple Rest JAX-RS Example

This example shows how to use Spring Web annotation to add rest-style access to triple protocol.

How to run

Start Zookeeper

This example replies on Zookeeper(3.8.0+) as service discovery registry center, so you need to run the Zookeeper server first, there are two ways to do so:

  1. Download zookeeper binary and start it directly
  2. Start zookeeper using docker

Install dependencies

Step into ‘dubbo-samples-triple-rest’ directory, run the following command:

$ mvn clean install

Start provider

Step into ‘dubbo-samples-triple-rest-jaxrs’ directory

then, run the following command to start application:

$ mvn compile exec:java -Dexec.mainClass="org.apache.dubbo.rest.demo.JaxrsRestApplication"

Run the following command to see server works as expected:

curl \
    --header "Content-Type: application/json" \
    'http://localhost:50052/demo/hello?name=world'

Or, you can visit the following link by using web browser: http://localhost:50052/demo/hello?name=world