Skip to content

microservice using spring boot, spring api gateway, netflix service discovery

License

Notifications You must be signed in to change notification settings

souravkantha/microservice-api-gateway-with-discovery

Repository files navigation

A Microservice Demo using spring boot, spring Netflix Eureka & spring Cloud Gateway

Architecture of this demo microservice

ms-demo drawio (1)

Java Version

Used open-jdk version 17 (https://openjdk.org/projects/jdk/17/)

Build Tool

We are using maven tool to build the project. You can download & install maven from official website (https://maven.apache.org/install.html)

Making the build

Download the source code using git ssh or https from https://github.com/souravkantha/microservice-demo

- [x] Check if maven is installed by putting 'mvn' command in command prompt or terminal

  • Go the root directory i.e; microservice-demo

  • Use command mvn clean package. Upon successful build creation will show below like screenshot

    Screenshot 2023-01-29 at 7 35 23 PM
  • 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

    Screenshot 2023-01-30 at 3 41 29 AM

    java -jar microservice-discovery-server/target/discovery-1.0.jar

    Upon successful start of the discovery server, you should see the something as below

    Screenshot 2023-01-29 at 7 40 26 PM
  • We can access the default dashboard of Eureka Server at http://localhost:8761/

    Screenshot 2023-01-29 at 7 45 40 PM
  • Now, start the VAT microservice in port 8081 & port 8082 using following command

    Screenshot 2023-01-30 at 3 41 37 AM

    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

    Screenshot 2023-01-30 at 3 41 46 AM

    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/

Screenshot 2023-01-29 at 7 52 43 PM

Screenshot 2023-01-29 at 1 39 55 AM

Releases

No releases published

Packages

No packages published

Languages