This example shows how to use Spring Web annotation to add rest-style access to triple protocol.
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:
Step into ‘dubbo-samples-triple-rest’ directory, run the following command:
$ mvn clean install
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