https://github.com/chriniko13/event-materializer-sample
https://github.com/chriniko13/event-materializer-sample
cdi hikari jackson joinfaces kafka-clients lombok mysql-connector spring-jdbc vavr
Last synced: 3 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/chriniko13/event-materializer-sample
- Owner: chriniko13
- Created: 2019-09-27T09:01:04.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2023-09-05T22:01:17.000Z (almost 2 years ago)
- Last Synced: 2025-01-11T23:47:37.015Z (5 months ago)
- Topics: cdi, hikari, jackson, joinfaces, kafka-clients, lombok, mysql-connector, spring-jdbc, vavr
- Language: Java
- Size: 25.4 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
### Event Materializer Sample
#### Description
Event materializer listens in a datasource (eg: MySQL, Kafka, etc.) where events are emitted
and materializes them to a in memory data structure (eg: map, list, etc.)Eg:
```
Datasource: [UserCreatedEvent, UserActivatedEvent, UserJoinedPointsMembershipEvent, ...]
Offset: 0 1 2 n|
|
|
[EVENT MATERIALIZER]
|
|
usersBuffer:[ userId:{user}, ... ]
```
Offset should only moves forward as time goes by (events added, etc)
More info about event sourcing: [Nice presentation of event sourcing](https://ookami86.github.io/event-sourcing-in-practice/#title.md)
#### Abstractions:
```text
[DATA-BUFFER] <--(2)-- [DATA-BUILDER] <--(1)-- [DATA-SOURCE]
```* (1) observes state-changes/events for specified datasource
* (2) updates contents of buffer with the ones received from datasource#### How to run
* Execute: `docker-compose up`* Execute: `mvn spring-boot:run`
* Visit: `http://localhost:1711/posts.xhtml`
* Execute (optional): `docker-compose down`