Skip to content

Commit e644071

Browse files
committed
refactoring: logging simplified, sync ACK/NACK, cleanup
1 parent c79c131 commit e644071

File tree

10 files changed

+194
-188
lines changed

10 files changed

+194
-188
lines changed

README.md

Lines changed: 21 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,12 @@ It is backing the [Fmodel Reference Guide](https://fraktalio.com/fmodel/).
55

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

8-
> 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:
9-
> - how the `domain` package/model is the same / state-stored system and event-sourced system share the same domain logic
8+
> For State-Stored flavor of the system, please
9+
>
10+
check [https://github.com/fraktalio/fmodel-spring-state-stored-demo](https://github.com/fraktalio/fmodel-spring-state-stored-demo),
11+
> and notice:
12+
> - how the `domain` package/model is the same / state-stored system and event-sourced system share the same domain
13+
logic
1014
> - `application and adapters are different / we only choose to compose and run them differentlly`
1115
1216

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

3842
Check the [tests](src/test/kotlin/com/fraktalio/example/fmodelspringdemo/domain/OrderDeciderTest.kt)!
43+
3944
```kotlin
4045
with(orderDecider) {
4146
givenEvents(listOf(orderCreatedEvent)) { // PRE CONDITIONS
@@ -59,10 +64,10 @@ sourcing and event streaming.
5964
- `event-streaming` to concurrently coordinate read over a streams of events from multiple consumer instances
6065
- Support real-time concurrent consumers to project events into view/query models
6166

62-
6367
## Tools
6468

65-
- [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.
69+
- [EventModeling](https://eventmodeling.org/posts/what-is-event-modeling/) - a method of describing systems using an
70+
example of how information has changed within them over time.
6671

6772
## Patterns
6873

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

7984
- [Fmodel - Domain modeling with Kotlin](https://github.com/fraktalio/fmodel)
8085
- [Kotlin](https://kotlinlang.org/) (Coroutines, Serialization)
81-
- 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)
86+
-
87+
88+
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/),
89+
RSocket)
90+
8291
- [Testcontainers](https://www.testcontainers.org/)
8392
- [PostgreSQL](https://www.postgresql.org/) ([event store](https://github.com/fraktalio/fstore-sql), projections)
8493

@@ -120,7 +129,8 @@ Run application and PostgreSQL:
120129
docker-compose up
121130
```
122131

123-
## Explore the REST API
132+
## Explore the REST API
133+
124134
Explore the REST API using the [test.http](test.http) file.
125135

126136
## Further Reading

src/main/kotlin/com/fraktalio/example/fmodelspringdemo/FmodelSpringDemoConfiguration.kt

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,11 +127,18 @@ class FmodelSpringDemoConfiguration {
127127
matchIfMissing = true
128128
)
129129
fun eventStreamProcessorBean(
130+
transactionalOperator: TransactionalOperator,
130131
eventStreamRepository: EventStreamRepository,
131132
lockRepository: LockRepository,
132133
viewRepository: ViewRepository,
133134
materializedView: MaterializedView<MaterializedViewState, Event?>
134-
) = EventStreamProcessor(eventStreamRepository, lockRepository, viewRepository, materializedView)
135+
) = EventStreamProcessor(
136+
transactionalOperator,
137+
eventStreamRepository,
138+
lockRepository,
139+
viewRepository,
140+
materializedView
141+
)
135142

136143
@Bean
137144
fun messageConverter(): KotlinSerializationJsonMessageConverter {

0 commit comments

Comments
 (0)