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) | +---------------+ +-------------+
+-------------------------------+
Eventsfrom event sourcing pattern are messages informing about the change in the state of the object.RabbitMQListenerparses received String to ObjectActionMessage and sends it toService.Serviceoperates the state of the object and sends action toActor.Actorprocesses the messages in one thread via event handlers.Controllergets 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