Demo application to go with Microservices Blog on the spring.io website.
I just modify it to run on consul.
- Install Consul, Please see the installation documentation for instructions on how to install Consul.
- In each window, change to the directory where you cloned the demo
- In the first window, run:
./src/main/bash/local_run_consul.sh
and wait for it to start up - In the second window, build the application using
mvn clean package
- In the same window run:
java -jar target/microservice-demo-consul-1.1.0.RELEASE.jar accounts
and wait for it to start up - In the third window run:
java -jar target/microservice-demo-consul-1.1.0.RELEASE.jar web
- In your favorite browser open the same two links: http://localhost:8500 and http://localhost:3333
You should see servers being registered in the log output of the first (registration) window. As you interact with the web-application (http://localhost:3333) you should logging appear in the second and third windows.
- In a new window, run up a second account-server using HTTP port 2223:
java -jar target/microservice-demo-consul-1.1.0.RELEASE.jar accounts 2223
- Allow it to register itself
- Kill the first account-server and see the web-server switch to using the new account-server - no loss of service.