dubbo/dubbo-demo
suncairong163 4f86a3bbfc
add spring mvc rest demo (#12188)
* add spring mvc rest demo

* FIX VERSION
2023-04-26 09:56:11 +08:00
..
dubbo-demo-annotation Bump spring-boot-maven-plugin from 2.7.10 to 2.7.11 (#12180) 2023-04-25 13:58:03 +08:00
dubbo-demo-api Bump spring-boot-maven-plugin from 2.7.10 to 2.7.11 (#12180) 2023-04-25 13:58:03 +08:00
dubbo-demo-generic-call optimize JsonUtils (#12057) 2023-04-11 11:24:55 +08:00
dubbo-demo-interface Feature/dubbo3.2 rest demo (#12183) 2023-04-25 14:34:21 +08:00
dubbo-demo-native Bump native-maven-plugin from 0.9.20 to 0.9.21 (#12103) 2023-04-19 09:48:17 +08:00
dubbo-demo-spring-boot Bump spring-boot.version from 2.7.10 to 2.7.11 (#12176) 2023-04-25 13:58:59 +08:00
dubbo-demo-triple Refactor pb version (#12109) 2023-04-18 10:04:52 +08:00
dubbo-demo-xml add spring mvc rest demo (#12188) 2023-04-26 09:56:11 +08:00
README.md Add -jar for java command in dubbo-demo readme file (#4517) 2019-07-10 13:27:11 +08:00
pom.xml Add dubbo spring boot demo (#9244) 2021-11-13 14:47:09 +08:00

README.md

Dubbo Demo

This directory contains basic usages of Dubbo to help Dubbo developers for debugging and smoke test purpose. If you are looking for Dubbo samples for study purpose, you should look into here where you will find comprehensive usages for how to use Dubbo in different scenarios with the different features.

How To Build

To build all demo applications from the source code, simply step into 'dubbo-demo' directory and use maven to build:

mvn clean package

After build completes, a couple of fat jars are generated under 'target' directory under each module directories, for example: 'dubbo-demo-api-provider-${project.version}.jar' can be found under the directory 'dubbo-demo/dubbo-demo-api/dubbo-demo-api-provider/target'.

How To Run

Since the generated artifacts are fat jars backed by spring boot maven plugin, they can be executed directly with 'java -jar', and since multicast is used for service registration, a necessary system property '-Djava.net.preferIPv4Stack=true' is required in order to registry and discover the demo service properly.

Use 'dubbo-demo/dubbo-demo-api' as an example, to start the provider 'dubbo-demo-api-provider', execute the following command:

java -Djava.net.preferIPv4Stack=true -jar dubbo-demo-api-provider-${project.version}.jar

To run the consumer 'dubbo-demo-api-consumer', execute the following command:

java -Djava.net.preferIPv4Stack=true -jar dubbo-demo-api-consumer-${project.version}.jar