Git Product home page Git Product logo

microservices-pipeline's Introduction

Spring cloud stream + RabbitMQ + Protobuf CI

This repository demonstrates microservices pipelines and communications using http and amqp protocols with JSON and Protobuf

 O__
/|   Hey, I wanna create user! 
/ \
     -> UserUI HTTP POST (JSON) request -> UserBackend
        -> UserBackend send converted (Protobuf) message -> RabbitMQ exchange
           -> RabbitMQ exchange send (Protobuf) message -> RabbitMQ UserService queue
              -> UserService send converted received User Entity insert query -> UserStore

 O__
/|   Hey, I wanna fetch user(s) data! 
/ \
     -> UserUI HTTP GET (JSON) request -> UserBackend
        -> UserBackend HTTP GET (Protobuf) request -> UserService
           -> UserService send User fetch query -> UserStore
        <- UserService <- User Entity from UserStore
     <- UserBackend <- Converted HTTP (Protobuf) response from UserService
  <- UserUI <- HTTP (JSON) resp from UserBackend

Quickstart

git clone --depth=0 https://github.com/daggerok/spring-cloud-stream-protobuf-rabbitmq.git my-app && cd $_

./mvnw -f rabbitmq docker:start
./mvnw -f user-service spring-boot:start
./mvnw -f user-backend spring-boot:start

open http://127.0.0.1:8001

Unit testing

./mvnw clean test

E2E testing

rm -rf ~/.m2/repository/microservices
./mvnw clean install -DskipTests
./mvnw -f rabbitmq docker:start

./mvnw -f user-service spring-boot:start
./mvnw -f user-backend -Pe2e test

./mvnw -f user-service spring-boot:stop
./mvnw -f rabbitmq docker:stop docker:remove

Manual integration testing

rm -rf ~/.m2/repository/microservices
./mvnw clean install -DskipTests
./mvnw -f rabbitmq docker:start

./mvnw -f user-service spring-boot:start # create durable queue
./mvnw -f user-service spring-boot:stop  # simulate downtime
./mvnw -f user-backend spring-boot:start # send messsage
curl -sSv 0:8001/api/v1/users -H'Content-Type:application/json' -d'{"username":"maksimko"}'
./mvnw -f user-service spring-boot:start # check message received

./mvnw -f user-backend spring-boot:stop
./mvnw -f user-service spring-boot:stop
./mvnw -f rabbitmq docker:stop docker:remove

RTFM

microservices-pipeline's People

Watchers

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