snapshot of https://github.com/ThreeDotsLabs/watermill.git (master, 2026-09-15; blobs > 131072B omitted)
Some checks failed
master / ci (push) Failing after 0s
Some checks failed
master / ci (push) Failing after 0s
This commit is contained in:
42
_examples/basic/5-cqrs-protobuf/README.md
Normal file
42
_examples/basic/5-cqrs-protobuf/README.md
Normal file
@@ -0,0 +1,42 @@
|
||||
# Example Golang CQRS application
|
||||
|
||||
This application is using [Watermill CQRS](http://watermill.io/docs/cqrs) component.
|
||||
|
||||
Detailed documentation for CQRS can be found in Watermill's docs: [http://watermill.io/docs/cqrs#usage](http://watermill.io/docs/cqrs).
|
||||
|
||||

|
||||
|
||||
```mermaid
|
||||
sequenceDiagram
|
||||
participant M as Main
|
||||
participant CB as CommandBus
|
||||
participant BRH as BookRoomHandler
|
||||
participant EB as EventBus
|
||||
participant OBRB as OrderBeerOnRoomBooked
|
||||
participant OBH as OrderBeerHandler
|
||||
participant BFR as BookingsFinancialReport
|
||||
|
||||
Note over M,BFR: Commands use AMQP queue, Events use AMQP pub/sub
|
||||
|
||||
M->>CB: Send(BookRoom)<br/>topic: commands.BookRoom
|
||||
CB->>BRH: Handle(BookRoom)
|
||||
|
||||
BRH->>EB: Publish(RoomBooked)<br/>topic: events.RoomBooked
|
||||
|
||||
par Process RoomBooked Event
|
||||
EB->>OBRB: Handle(RoomBooked)
|
||||
OBRB->>CB: Send(OrderBeer)<br/>topic: commands.OrderBeer
|
||||
CB->>OBH: Handle(OrderBeer)
|
||||
OBH->>EB: Publish(BeerOrdered)<br/>topic: events.BeerOrdered
|
||||
|
||||
EB->>BFR: Handle(RoomBooked)
|
||||
Note over BFR: Updates financial report
|
||||
end
|
||||
```
|
||||
|
||||
|
||||
## Running
|
||||
|
||||
```bash
|
||||
docker-compose up
|
||||
```
|
||||
Reference in New Issue
Block a user