Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/daggerok/event-sourced-user-management

Status: IN PROGRESS. CQRS and event sourcing using plain embedded into jdk com.sun.net.httpserver with dynamic groovy spock tests
https://github.com/daggerok/event-sourced-user-management

cqrs cqrs-es es event-sourcing eventsourcing eventstore fatjar gradle-groovy-dsl groovy spock spock-framework spock-groovy spock-tests

Last synced: 17 days ago
JSON representation

Status: IN PROGRESS. CQRS and event sourcing using plain embedded into jdk com.sun.net.httpserver with dynamic groovy spock tests

Awesome Lists containing this project

README

        

# CQRS and event sourcing app [![Build Status](https://travis-ci.org/daggerok/event-sourced-user-management.svg?branch=master)](https://travis-ci.org/daggerok/event-sourced-user-management)
CQRS and event sourcing using plain embedded into jdk `com.sun.net.httpserver` with dynamic groovy spock tests

## TL;DR
this is an example of event sourced system I'm using for teaching my students, so please, don't even try
use it in production: Also read: [Why Developers Should Not Write Programs That Call 'sun' Packages](https://www.oracle.com/technetwork/java/faq-sun-packages-142232.html)

Status: in progress...

RoadMap:
- ~~Setup Gradle / Groovy repository with Spring IoC dependency injection and Spock test framework~~
- ~~Implement REST API with plain java embedded http server~~
- ~~Implement basic REST API info and shutdown endpoints~~
- ~~Implement and cover with tests User Account aggregate functionality~~
- ~~Implement and cover with tests User Account aggregate repository functionality~~
- ~~Implement user-account REST API endpoints~~
- ~~Implement Friend Request aggregate functionality~~
- ~~Implement Friend Request aggregate repository functionality~~
- Implement friend-request REST API endpoints
- Implement messenger aggregate functionality
- Implement messenger aggregate repository functionality
- Implement messenger REST API endpoints
- Implement async PubSub / Queue functionality to decouple direct REST API calls from aggregate repository
- Introduce read (query) side to avoid non efficient event sourcing repository querying
- Split current REST API into CQRS for eventual consistency and projections efficiency
- Implement CLI interface which is going to be interact with REST API by using CQRS
- Prepare future RoadMap for EventStore persistence introduction:
- MapDB
- JDBC
- JPA
- Spring Data
- NoSQL
- etc...
- Prepare future RoadMap for PubSub introduction:
- plain pub-sub patter implementation
- simple im-memory pub-sub solution from Google or Android library
- Using spring application events
- Kafka

**NOTE:** _For better developer experience during testing, use idea cURL integration tests from `rest-client*` files. Read more: https://www.jetbrains.com/help/idea/http-client-in-product-code-editor.html_

## why?

just see how everything is clear in next analitics:

```yaml
events:
- OrderCreated(id=123)
- ItemAdded(product=Bose Headphones, price=400)
- FollowSimilarItemsLink(product=Sony Headphones)
- AccessReviews()
- VoteReviewHelpful(answer=5/5)
- ItemAdded(product=Sony Headphones, price=450)
- ItemRemoved(product=Bose Headphones, price=400)
- OrderConfirmed()
- OrderShipped()
```

resources:

* [@Log4l2](https://logging.apache.org/log4j/2.x/maven-artifacts.html)