Skip to content

this repo demonstrate CQRS data transfer in REST API and messaging microservices. it’s containing (async RabbitMQ messaging and sync REST microservices) data models processing. spring-boot, rabbit, postgre, spring-data, spring-cloud-stream, gradle, docker, docker-compose, RabbitMQ, spring-cloud-starter-stream-rabbit, PostgreSQL, CQRS, Event Sour…

Notifications You must be signed in to change notification settings

dorucioclea/spring-boot-twitter

 
 

Repository files navigation

spring-boot-twitter Build Status

added all backing- and micro- services into sinle docker-compose

see: ./twitter-docker/twitter-docker-services/src/docker-compose.yml

this repo demonstrate CQRS data transfer in REST API and messaging microservices. it’s containing (async RabbitMQ messaging and sync REST microservices) data models processing:

  1. main idea here is: each microservice doing single simple job, but doing it well, efficient and fast

  2. actor 1: twitter-data - single service which is listenning creation entity command (event) and store input data into RDBMS (Postgre SQL)

  3. actor 2: scalable twitter-commander service, which is send async tweets creation commands

  4. actor 3: scalable twitter-query service, which is only reading tweets from read-only datasorce. in production systems should be moved out from operational RDBMS to some nosql scalable / replicateble solution, such mongodb, or any other more siutable for you

  5. in addition: common reusable subprojects, such domain and entity api…​

  6. important keywords:

    • CQRS, event sourcing

    • reactive streams, event-driven architecture

    • messaging pipelines, non-blocking data processing

reads (can be improoved by spring 5 reactive programming model using Mono / Flux)

[client] <-> (http get) <-> [twitter-query] <-> (jdbc select) <-> [rdbms]

# with webflux and reactive data-source could also be non blocking:
[client] <~> (http get sse) <~> [twitter-query (webflux)] <~> (reactive flux) <~> [mongo]

writes (also can be improved by replacing rdbms solution with some siutable reactive nosql)

[client] -> (http post) -> [twitter-command] ~> (send async) ~> [twitter-data] <-> (jdbc insert) <-> [rdbms]

note:

  1. <-> - sync processing

  2. <~> - async processing

quick start

gradle --parallel bootRun

http post :8881 data=test-tweet1
http post :8881 data=test-tweet2

http get :8882

gradle --stop

stack:

  1. spring-boot

  2. spring-data

  3. spring-cloud-stream

  4. RabbitMQ

  5. Postgres

  6. docker (docker-compose)

  7. gradle

  8. install spring app as linux service

  9. CQRS and Event Sourcing

  10. event-driven architecture

  11. reactive streams, non-blocking data processing

About

this repo demonstrate CQRS data transfer in REST API and messaging microservices. it’s containing (async RabbitMQ messaging and sync REST microservices) data models processing. spring-boot, rabbit, postgre, spring-data, spring-cloud-stream, gradle, docker, docker-compose, RabbitMQ, spring-cloud-starter-stream-rabbit, PostgreSQL, CQRS, Event Sour…

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Java 100.0%