tree: 333cbe01d17ea3deaa9b29f74fe571e46476e1af [path history] [tgz]
  1. src/
  2. case-configuration.yml
  3. case-versions.conf
  4. pom.xml
  5. README.md
dubbo-samples-consul/README.md

Dubbo Consul Example

This example shows how to use consul as Dubbo's registry center

How To Run

Step 1. Start Consul as Registry Center

In this example, a docker compose file is provided to start the required consul agent easily. But at the same time, it requires you to prepare docker environment as a prerequisite. You can refer to docker quick start to install.

docker run -p8500:8500 consul:latest

You may need also check further from Consul Devops Handbook.

Step 2. Build Examples

Execute the following maven command under dubbo-samples-consul directory, or simply import the whole sample project into IDE.

mvn clean package

Step 3. Run Examples

  1. Run ConsulProvider to start service provider
  2. Run ConsulConsumer to start service consumer, you should see the following result in the console:
result: hello, consul