Code Monkey home page Code Monkey logo

spring-cloud-event-sourcing-example's Introduction

Spring Cloud Event Sourcing Example

This reference application is a Spring Cloud example of using event sourcing in microservices. The project is intended to demonstrate end-to-end best practices for building a Netflix-like microservice architecture using Spring Cloud.

Tutorial provided here: http://www.kennybastani.com/2016/04/event-sourcing-microservices-spring-cloud.html

  • Spring Cloud OAuth2
    • Authorization Server
    • Resource Server
  • Edge Service
    • API gateway with OAuth2 protected resources
    • OAuth2 SSO
  • Event-driven Messaging
    • Event sourcing

Architecture Diagram

Online Store Architecture Diagram

Online Store Domain

This reference application is based on common design patterns for building an ecommerce application. The application includes the following microservices.

  • Discovery Service
  • Edge Service
  • User Service
  • Catalog Service
  • Account Service
  • Order Service
  • Inventory Service
  • Online Store Web
  • Shopping Cart Service

Usage

Microservice architectures commonly use multiple databases. The resources of the business domain are distributed across the microservice architecture, with each service having its own exclusive database. Each type of database for a microservice is commonly chosen by a development team based on its advantages when solving a specific problem.

This reference application uses the following mixture of databases.

  • MySQL - RDBMS
  • Neo4j - GraphDB
  • MongoDB - Document Store
  • Redis - Key/value Store

Integration Testing

If you would like to use Docker for integration testing, a docker-compose.yml file has been provided in the root directory. To build all the images, first make sure that you have Docker installed and available in your command line tool. With Docker and Docker Compose installed, execute the provided run.sh script. This script will build each container and start each of the services and database dependencies. When all the services have started up. Verify that the services are registered with Eureka at http://$DOCKER_IP:8761.

If everything has loaded correctly, navigate to the online store at http://DOCKER_IP:8787/. Click Login. You'll be navigated to the authorization server's gateway at http://DOCKER_IP:8181/uaa/login. The username is user and the password is password. You'll be authenticated and asked to approve token grant to the online web store. After accepting the grant, you'll be redirected to the online store application where you'll be able to access protected resources from the edge service.

License

This project is licensed under Apache License 2.0.

spring-cloud-event-sourcing-example's People

Contributors

barrycommins avatar destan avatar kbastani avatar myminseok avatar

Watchers

 avatar  avatar

Forkers

prasenjitm9

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.