Skip to content

Commit

Permalink
refactoring: logging simplified, sync ACK/NACK, cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
idugalic committed Nov 22, 2023
1 parent c79c131 commit e644071
Show file tree
Hide file tree
Showing 10 changed files with 194 additions and 188 deletions.
32 changes: 21 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,12 @@ It is backing the [Fmodel Reference Guide](https://fraktalio.com/fmodel/).

It demonstrates how to run our unique domain and orchestrate it in an EventSourced/EventDriven way.

> For State-Stored flavor of the system, please check [https://github.com/fraktalio/fmodel-spring-state-stored-demo](https://github.com/fraktalio/fmodel-spring-state-stored-demo), and notice:
> - how the `domain` package/model is the same / state-stored system and event-sourced system share the same domain logic
> For State-Stored flavor of the system, please
>
check [https://github.com/fraktalio/fmodel-spring-state-stored-demo](https://github.com/fraktalio/fmodel-spring-state-stored-demo),
> and notice:
> - how the `domain` package/model is the same / state-stored system and event-sourced system share the same domain
logic
> - `application and adapters are different / we only choose to compose and run them differentlly`

Expand All @@ -28,14 +32,15 @@ This project is using [Fmodel](https://github.com/fraktalio/fmodel) - Kotlin, mu
- type-safe and
- thread-safe.
- enabling illustrating requirements using examples
- the requirements are presented as scenarios.
- a scenario is an example of the system’s behavior from the users’ perspective,
- the requirements are presented as scenarios.
- a scenario is an example of the system’s behavior from the users’ perspective,
- and they are specified using the Given-When-Then structure to create a testable/runnable specification
- Given `< some precondition(s) / events >`
- When `< an action/trigger occurs / commands>`
- Then `< some post condition / events >`
- Given `< some precondition(s) / events >`
- When `< an action/trigger occurs / commands>`
- Then `< some post condition / events >`

Check the [tests](src/test/kotlin/com/fraktalio/example/fmodelspringdemo/domain/OrderDeciderTest.kt)!

```kotlin
with(orderDecider) {
givenEvents(listOf(orderCreatedEvent)) { // PRE CONDITIONS
Expand All @@ -59,10 +64,10 @@ sourcing and event streaming.
- `event-streaming` to concurrently coordinate read over a streams of events from multiple consumer instances
- Support real-time concurrent consumers to project events into view/query models


## Tools

- [EventModeling](https://eventmodeling.org/posts/what-is-event-modeling/) - a method of describing systems using an example of how information has changed within them over time.
- [EventModeling](https://eventmodeling.org/posts/what-is-event-modeling/) - a method of describing systems using an
example of how information has changed within them over time.

## Patterns

Expand All @@ -78,7 +83,11 @@ sourcing and event streaming.

- [Fmodel - Domain modeling with Kotlin](https://github.com/fraktalio/fmodel)
- [Kotlin](https://kotlinlang.org/) (Coroutines, Serialization)
- Spring ([Reactive Web](https://docs.spring.io/spring-boot/docs/3.0.4/reference/htmlsingle/#web.reactive),[R2DBC](https://spring.io/guides/gs/accessing-data-r2dbc/), RSocket)
-

Spring ([Reactive Web](https://docs.spring.io/spring-boot/docs/3.0.4/reference/htmlsingle/#web.reactive),[R2DBC](https://spring.io/guides/gs/accessing-data-r2dbc/),
RSocket)

- [Testcontainers](https://www.testcontainers.org/)
- [PostgreSQL](https://www.postgresql.org/) ([event store](https://github.com/fraktalio/fstore-sql), projections)

Expand Down Expand Up @@ -120,7 +129,8 @@ Run application and PostgreSQL:
docker-compose up
```

## Explore the REST API
## Explore the REST API

Explore the REST API using the [test.http](test.http) file.

## Further Reading
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -127,11 +127,18 @@ class FmodelSpringDemoConfiguration {
matchIfMissing = true
)
fun eventStreamProcessorBean(
transactionalOperator: TransactionalOperator,
eventStreamRepository: EventStreamRepository,
lockRepository: LockRepository,
viewRepository: ViewRepository,
materializedView: MaterializedView<MaterializedViewState, Event?>
) = EventStreamProcessor(eventStreamRepository, lockRepository, viewRepository, materializedView)
) = EventStreamProcessor(
transactionalOperator,
eventStreamRepository,
lockRepository,
viewRepository,
materializedView
)

@Bean
fun messageConverter(): KotlinSerializationJsonMessageConverter {
Expand Down
Loading

0 comments on commit e644071

Please sign in to comment.