Code Monkey home page Code Monkey logo

pet-clinic-microservices's Introduction

Spring PetClinic Microservices Project

CircleCI

This is my Microservices implementation of the famous Spring PetClinic Project.

A General Overview of the Spring PetClinic Project using Diagrams

View Diagrams

Project Overview

This is a Spring Boot project that is built using Maven. It uses the following Spring Cloud sub projects:

  • Spring Cloud Config
  • Eureka Discovery Service
  • Zuul API Gateway
  • Hystrix
  • Feign Clients

This project is divided into six different microservices and a web application interface. You can start each of the services locally or you can use docker-compose to build a set of Docker images to run the entire application.

First, you'll need to pull down the project:

git clone https://github.com/rje0929/pet-clinic-microservices

You also need:

  • Java 8
  • Maven installed
  • Docker installed - I recommend installing Docker for Mac or Docker for Windows using the download utilities from the Docker website. Using tools such as brew to install Docker may leave out some of the components needed such as docker-compose.
  • Change Memory setting in Docker - Because there are six Docker containers running, I had to set my Docker memory to 4 GB to avoid OutOfMemory issues. The standard is 2 GB. This can be changed in the Docker -> Preferences -> Advanced -> Memory section of the Docker app. Don't forget to restart Docker after you make the changes!

If you don't want to use Docker, you'll have to start each one of the services manually. I'd recommend starting them in them in this order:

  • Config Service
  • Eureka Service
  • Zuul Service
  • Owner Service, Visits Service, Vets Service can be started in any order
  • Web Interface

If you're using Docker, run the following commands:

cd pet-clinic-microservices
./build_images.sh
docker-compose up

Once startup of all of the services is complete you can view the application at http://localhost:8080. To view the list of services through Eureka, visit http://localhost:8761.

The build images script may take several minutes to run. The build script uses the -DskipTests flag for Maven. The reason for this is that each service is looking for the Eureka service (that's not currently running) while they are building. You may also see a few exceptions when the containers come up as they wait for the Eureka service and the Config service to start. To my knowledge, the docker-compose utility does not have a graceful way of starting containers in such a way that a container can wait for the successful start of dependent containers. So I have made the services more resilient by adding the spring-retry module.

pet-clinic-microservices's People

Contributors

rje0929 avatar

Watchers

James Cloos 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.