Used open-jdk version 17 (https://openjdk.org/projects/jdk/17/)
We are using maven tool to build the project. You can download & install maven from official website (https://maven.apache.org/install.html)
Download the source code using git ssh or https from https://github.com/souravkantha/microservice-demo
-
Go the root directory i.e; microservice-demo
-
Use command
mvn clean package
. Upon successful build creation will show below like screenshot -
All the necessary jars (microservice builds) should be created by now
-
Start the Eureka Server for service discovery i.e; microservice-discovery-server by providing the following command
java -jar microservice-discovery-server/target/discovery-1.0.jar
Upon successful start of the discovery server, you should see the something as below
-
We can access the default dashboard of Eureka Server at http://localhost:8761/
-
Now, start the VAT microservice in port 8081 & port 8082 using following command
java -jar -Dserver.port=8081 microservice-vat-service/target/vat-1.0.jar
java -jar -Dserver.port=8082 microservice-vat-service/target/vat-1.0.jar
java -jar -Dserver.port=8080 api-gateway/target/gateway-1.0.jar
-
The VAT microservices will be auto registered to the service discovery and we can see it at http://localhost:8761/
- You can view the API doc using swagger-ui at http://localhost:8081/swagger-ui/index.html