Skip to content

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

Notifications You must be signed in to change notification settings

daggerok/microservices-pipeline

Repository files navigation

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

About

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

Topics

Resources

Stars

Watchers

Forks