Spring Boot applications/microservices demo using Consul discovery & config
In this project I'm demonstrating you how to use Hashicorp's Consul as a discovery and configuration server with Spring Cloud Consul and other Spring Cloud projects for building microservice-based architecture.
$ docker run -d --name consul-1 -p 8500:8500 -e CONSUL_BIND_INTERFACE=eth0 consul
mvn clean install
command and using java -jar ...
command. Or you can just build it and run using your IDE. Each application is listeting on dynamically generated port.Our sample microservices-based system consists of the following modules:
The following picture illustrates the architecture described above.
When running sample applications we can test more advanced scenario. We may leverage Zone Affinity mechanism to prefer communication inside a single zone. We can also start a cluster of Consul modes started locally on Docker containers. Here's the picture illustrating such an architecture:
Detailed description can be found here: Microservices with Spring Boot, Spring Cloud Gateway and Consul Cluster