Code Monkey home page Code Monkey logo

microservices-v8's Introduction

Learn Microservices with Spring Boot - v8

This project contains the version 8 of the application that is developed under the scope of the book Learn Microservices with Spring Boot. You can get a copy of the book on Amazon or Apress.

The book shows you how to evolve a simple Spring Boot application to become a full Microservices Architecture, using Spring Cloud Eureka, Ribbon, Zuul and Hystrix to implement Service Discovery, Load Balancing, the API Gateway pattern and a Circuit Breaker. Besides, you'll learn how to implement End-to-End tests with Cucumber, an Event-Driven system and the best practices when building Microservices.

Idea

These projects, included in Microservices-Practical repositories, illustrate how to start an application from scratch and then evolve it to become a full microservices environment.

This version introduces Load Balancing with Ribbon, configured to detect services that are down through a PingUrl and combined with an AvailabilityFilteringRule.

Contents

The repository contains five folders, one for each component of the system:

  • social-multiplication is one of the backend services. It has a REST API to get and provide results to simple multiplications. When an attempt is sent, it triggers an event.
  • gamification is the second backend service. It provides a REST API to get game stats and reacts to the event sent by the multiplication service, updating the figures.
  • service-registry is the Eureka Server, which is contacted by backend services and the gateway.
  • gateway is the Routing Service, implemented with Zuul. It connects with Eureka for service discovery, and performs load balancing with Ribbon.
  • ui contains the static files of the frontend application. It's configured to be started with Jetty.

How to execute the application

Since in this version we don't have yet scripts to do it, we need to run the applications manually. These are the instructions:

  • UI. Download and install Jetty. From the command line, execute java -jar [JETTY_HOME]/jetty-[VERSION]/start.jar (replace the values between brackets accordingly). You also need Java.
  • RabbitMQ. Download and install RabbitMQ. We use it as Event bus. When you have installed it, you need to run the RabbitMQ server (as a service or as a process, whatever you prefer).
  • Multiplication, Gamification, Service Registry and Gateway. You need to start all these services using the command line. Navigate to each folder and execute for every one of them: ./mvnw spring-boot:run. If you want to try load balancing you can execute more than one instance of the Multiplication or Gamification service. To do that, override the port number to avoid clashing: ./mvnw spring-boot:run -Drun.arguments="--server.port=A_FREE_PORT]"

Application - version 8

Do you want to know more?

If you want more details about the different application parts and how to get there from scratch, you can buy the book if you don't have it yet: Learn Microservices with Spring Boot on Amazon or Apress

microservices-v8's People

Contributors

mechero 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.