Skip to content
This repository was archived by the owner on Jun 27, 2024. It is now read-only.

Commit 84b6f77

Browse files
committed
Clarification
1 parent 63258bb commit 84b6f77

File tree

1 file changed

+20
-9
lines changed

1 file changed

+20
-9
lines changed

README.md

+20-9
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,35 @@
1-
# Bookings Sample Application
1+
# Bookings sample application - Postgres
22

3-
This projects shows some of the features of Eventuous
4-
5-
//TODO
6-
Describe features used
3+
This projects shows some of the features of Eventuous:
4+
* Event-sourced domain model using `Aggregate` and `AggregateState`
5+
* Aggregate persistence using PostgreSQL
6+
* Read models in MongoDB
7+
* Integration between services using messaging (RabbitMQ)
78

89
## Usage
910

11+
Start the infrastructure using Docker Compose from the repository root:
12+
13+
```bash
14+
docker compose up
15+
```
16+
1017
Run both `Bookings` and `Bookings.Payments` projects and then open `http://localhost:5051/swagger/index.html` and `http://localhost:5000/swagger/index.html` respectively.
11-
Here you can use SwaggerUI to initiate commands and queries that will result in events being raised.
18+
Here you can use SwaggerUI to initiate commands that will result in events being raised.
1219

1320
### Example commands
1421

1522
Bookings -> BookRoom (`/bookings/book`)
1623

17-
This command raises and event which is stored in the database but also in Mongo via a registered projection
24+
This command raises an event, which gets stored in the database.
25+
A real-time subscription triggers a projection, which adds or updates two documents in MongoDB: one for the booking and one for the guest.
1826

1927
Bookings.Payments -> RecordPayment (`/recordPayment`)
2028

21-
This command raises multiple events which is stored in the database but also puts a message in RabbitMQ which is transformed from a domain event into an integration event. Upon the integration event being handled logic and other domain events are triggered resulting
22-
in more database entries and Mongo projection data being stored.
29+
When this command is executed, it raises a `PaymentRecorded` event, which gets persisted to the database.
30+
A gateway inside the Payments service subscribes to this event and publishes an integration event to RabbitMQ.
31+
An integration RabbitMQ subscription receives the integration event and calls the Bookings service to execute the `RecordPayment` command, so it acts as a Reactor.
32+
When that command gets executed, it raises a `PaymentRecorded` event, which gets persisted to the database. It might also raise a `BookingFullyPaid` or `BookingOverpaid` events, depending on the amount.
33+
Those new events are projected to MongoDB document in the `Bookings` collection using the read-model subscription.
2334

2435
Bookings.Payments -> `CommandService:RecordPayment` -> `PaymentRecorded` -> `IntegrationSubscription` -> `BookingPaymentRecorded` -> Bookings -> RabbitMQSubscription -> `PaymentsIntegrationHandler` -> `BookingsCommandService:OnExisting<RecordPayment>` -> `V1.PaymentRecorded` -> `BookingState:On<V1.PaymentRecorded>`-> `V1.BookingFullyPaid` -> `BookingStateProjection:On<V1.PaymentRecorded>` -> `BookingStateProjection:On<V1.BookingFullyPaid>`

0 commit comments

Comments
 (0)