Giter Club home page Giter Club logo

microservices-demo's Introduction

microservices-demo

Demo application to go with my Microservices Blog on the spring.io website.

Demo System Schematic

Clone it and either load into your favorite IDE or use maven directly.

Versions

To access V1.0.0 of the repo, corresponding to Spring Cloud release-train Angel.SR6, click on the release tab in https://github.com/paulc4/microservices-demo.

Using an IDE

You can run the system in your IDE by running the three servers in order: RegistrationService, AccountsService and WebService.

As discussed in the Blog, open the Eureka dashboard http://localhost:1111 in your browser to see that the ACCOUNTS-SERVICE and WEB-SERVICE applications have registered. Next open the Demo Home Page http://localhost:3333 in and click one of the demo links.

The localhost:3333 web-site is being handled by a Spring MVC Controller in the WebService application, but you should also see logging output from AccountsService showing requests for Account data.

Command Line

You may find it easier to view the different applications by running them from a command line since you can place the three windows side-by-side and watch their log output

To do this, open three CMD windows (Windows) or three Terminal windows (MacOS, Linux) and arrange so you can view them conveniently.

  1. In each window, change to the directory where you cloned the demo
  2. In the first window, build the application using mvn clean package
  3. In the same window run: java -jar target/microservice-demo-1.1.0.RELEASE.jar registration and wait for it to start up
  4. Switch to the second window and run: java -jar target/microservice-demo-1.1.0.RELEASE.jar accounts and again wait for it to start up
  5. In the third window run: java -jar target/microservice-demo-1.1.0.RELEASE.jar web
  6. In your favorite browser open the same two links: http://localhost:1111 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.

  1. In a new window, run up a second account-server using HTTP port 2223:
    • java -jar target/microservice-demo-0.0.1-SNAPSHOT.jar accounts 2223
  2. Allow it to register itself
  3. Kill the first account-server and see the web-server switch to using the new account-server - no loss of service.

microservices-demo's People

Contributors

kasunsk avatar paulc4 avatar shahid21st avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.