• Stars
    star
    723
  • Rank 62,657 (Top 2 %)
  • Language
    Java
  • License
    Apache License 2.0
  • Created over 9 years ago
  • Updated 4 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Sample of a Microservice setup for my book. Based on Spring Cloud / Netflix / Java / Docker / Docker Compose / Docker Machine / Vagrant

Microservice Sample

Translations:

This is a sample for my Microservices Book (English / German).

This project creates a VM with the complete micro service demo system in Docker containers inside a Vagrant VM. The services are implemented in Java using Spring and Spring Cloud.

It uses three microservices:

  • Order to process orders.
  • Customer to handle customer data.
  • Catalog to handle the items in the catalog.

Technologies

  • Eureka for Lookup
  • Ribbon for Load Balancing. See the classes CatalogClient and CustomerClient in com.ewolff.microservice.order.clients in the microservice-demo-order project.
  • Hystrix is used for resilience. See CatalogClient in com.ewolff.microservice.order.clients in the microservice-demo-order project . Note that the CustomerClient won't use Hystrix. This way you can see how a crash of the Customer microservices makes the Order microservice useless.
  • Hystrix has a dashboard. Turbine can be used to combine the data from multiple sources. However, this does not work at the moment.
  • Zuul is used to route HTTP requests from the outside to the different services.
  • Spring Cloud Config isn't used. It is disabled with spring.cloud.config.enabled=false in the bootstrap files.

How To Run

The demo can be run with Vagrant or Docker Machine and Docker Compose.

How to run includes more details.

Translations:

Remarks on the Code

The servers for the infrastructure are pretty simple thanks to Spring Cloud:

  • microservice-demo-eureka is the Eureka server for service discovery.
  • microservice-demo-zuul is the Zuul server. It distributes the requests to the three microservices.
  • microservice-demo-turbine can be used to consolidate the Hystrix metrics and has a Hystrix dashboard.

The microservices are:

  • microservice-demo-catalog is the application to take care of items.
  • microserivce-demo-customer is responsible for customers.
  • microservice-demo-order does order processing. It uses microservice-demo-catalog and microservice-demo-customer. Ribbon is used for load balancing and Hystrix for resilience.

The microservices have a Java main application in src/test/java to run them stand alone. microservice-demo-order uses a stub for the other services then. Also, there are tests that use customer driven contracts. That is why it is ensured that the services provide the correct interface. These CDC tests are used in microservice-demo-order to verify the stubs. In microserivce-demo-customer and microserivce-demo-catalog they are used to verify the implemented REST services.

More Repositories

1

microservice-kafka

Demo to show how Apache Kafka can be used for communication between microservices
Java
585
star
2

microservice-kubernetes

Microservices example using Kubernetes
Java
207
star
3

microservice-istio

Example for a microservices system based in Kubernetes and the service mesh Istio
Java
185
star
4

microservice-consul

Sample of a Microservice setup for my book ported to Consul / Apache httpd. Based on Spring Cloud / Netflix / Java / Docker / Docker Compose / Docker Machine
Java
106
star
5

user-registration

Continuous Delivery example: Chef, Docker, Jenkins, Graphite, ELK stack, jBehave, Selenium, Gatling
Ruby
65
star
6

InformatikFAQ

Informatik als Beruf FAQ
52
star
7

SCS-ESI

Demo for Self-contained Systems (SCS) using ESI (Edge Side Includes) with Varnish for Frontend Integration
Java
45
star
8

user-registration-V2

Java
38
star
9

spring-boot-demos

Some demos for Spring Boot
Java
38
star
10

microservice-atom

Demo to show how Atom can be used for communication between microservices
Java
32
star
11

microservice-consul-dns

Microservices Demo. Uses Consul as DNS server, registration is automated using Registrator
Java
21
star
12

microservice-linkerd

Microservices example with Linkerd service mesh
Java
16
star
13

crimson-assurance-demo

Demo for frontend integration
Dockerfile
14
star
14

cheatsheets-DE

Kurze Ãœbersichten / Cheatsheets zu Maven und Docker
14
star
15

microservice-spring

A microservices sample using Spring Boot features
Java
14
star
16

scala-spring

Shows how Scala and Spring can be integrated
Scala
12
star
17

microservice-cloudfoundry

Microservices demo using Cloud Foundry
Java
12
star
18

software-architektur.tv

software-architektur.tv Website
CSS
10
star
19

SCS-jQuery

Demo for Self-contained Systems (SCS) using jQuery for Frontend Integration
Java
9
star
20

microservices-rezepte

Source für Broschüre "Microservices Rezepte"
9
star
21

Spring-Integration-Web-Services-Batch-Demo

Demo of Spring Web Services, Spring Batch and Spring Integration
Java
8
star
22

microservices-primer

Source for booklet "Microservices Primer"
Shell
8
star
23

microservice-dapr

A microservices sample using Dapr
Java
7
star
24

spring-redis-demo

Shows how Spring can be used to access the Redis NoSQL store
Java
6
star
25

bildungsinitiativen

List von verschiedenen Bildungsinitiativen im Bereich Software-Entwicklung
5
star
26

docker-java

Very small Java image for Docker
5
star
27

microservices-vm

Creates a virtual machine with the Microservices demo and the Continuous Delivery demo
Shell
4
star
28

microservices-ueberblick

Source für Broschüre "Microservices Überblick"
4
star
29

lvm-demo

LVM Demo shows principles of ROCA and SCS
3
star
30

Spring-Buch

Repository for the Spring book (German)
Java
2
star
31

ewolff.com

Eberhard Wolff's Homepage
CSS
2
star
32

service-mesh-primer

Source for booklet "Service Mesh Primer"
Makefile
2
star
33

practical-microservices.com

XSLT
2
star
34

microservices-recipes

Source for booklet "Microservices Recipes"
2
star
35

seneca-example

A simple example using the Seneca framework
JavaScript
2
star
36

spring-buch.de

Website für das Spring Buch
HTML
1
star
37

JavaChefVagrantEC2

Ruby
1
star
38

spring-rabbit-demo

Demo how to use Spring AMQP and RabbitMQ
Java
1
star
39

microservices-buch.de

Website für das Microservices Buch
XSLT
1
star
40

redis-docker

Redis installation with Docker
Shell
1
star
41

news-application-heroku

Java
1
star
42

war-demo

Demo for Nanoservices using WARs and Tomcat
Java
1
star
43

microservices-praxisbuch.de

XSLT
1
star
44

continuous-delivery-buch.de

Website für das Continuous Delivery Buch
XSLT
1
star
45

erlang-example

Simple example for an Erlang client / server
Erlang
1
star