This project is generated by start.dubbo.apache.org and used as the demonstration code of the quick-start on our official website dubbo.apache.org.
Check more samples from other directories like 1-basic, 2-advanced, etc.
Step into ‘11-quickstart’ directory, run the following command:
$ ./mvnw clean install
This will install all the modules especially quickstart-api
in the local maven repo.
Enter quickstart-service
directory:
$ cd 11-quickstart/quickstart-service
then, run the following command to start Dubbo process:
$ ./mvnw compile -pl quickstart-service exec:java -Dexec.mainClass="org.apache.dubbo.samples.quickstart.QuickStartApplication"
Run the following command to see server works as expected:
$ curl \ --header "Content-Type: application/json" \ --data '["Dubbo"]' \ http://localhost:50051/org.apache.dubbo.samples.quickstart.dubbo.api.DemoService/sayHello/
或者
curl \ --header "Content-Type: application/json" \ --data '{"name":"Dubbo"}' \ http://localhost:50051/org.apache.dubbo.samples.quickstart.dubbo.api.DemoService/sayHello/
Publish the Dubbo service definition(java interface) in quickstart-api
to maven repository so that consumers that need to call this service can import the definition by importing quickstart-api
maven dependency in their pom.xml.
Enter directory quickstart-api
$ cd 11-quickstart/quickstart-api $ mvn clean deploy
For further reference, please consider the following sections: