This repository contains study project for distributed scalable service cluster that is based on the event sourcing pattern.
Event Sourcing
is a persistence approach based on storing a stream of events instead of the current state of an object.
+-------------------------------+ +---------------+ +-------------+
| Message |---►| Command |---►| Event |
--------------------------------- ----------------- ---------------
| Contains: | | AddObject, | | Contains: |
| ClassName, | | DeleteObject, | | ClassState, |
| ObjectType, | | GetAllObjects | | ClassEvent |
| ObjectActionType (ADD/DELETE) | +---------------+ +-------------+
+-------------------------------+
Events
from event sourcing pattern are messages informing about the change in the state of the object.RabbitMQListener
parses received String to ObjectActionMessage and sends it toService
.Service
operates the state of the object and sends action toActor
.Actor
processes the messages in one thread via event handlers.Controller
gets the current state of the classes.
+------------------------+ +----------------------+
| RabbitMQListener |◄----| RabbitMQConfig |
+------------------------+ +----------------------+
|
▼
+---------------------+ +------------------+
| Class Service |---►| Controller |
+---------------------+ +------------------+
▲
|
▼
+----------------+ +-------------------+ +------------------+
| Event Sourcing |---►| Class Actor |◄----| AkkaConfig |
| Properties | +-------------------+ +------------------+
+----------------+
- Kotlin + Gradle 7.1.1
- Spring Boot
- Akka