prooph-saga-playground
prooph-saga-playground copied to clipboard
Small CLI application to introduce Saga pattern.
prooph-saga-playground
Small CLI application to introduce Saga pattern. It reflects the business process of making a reservation. It uses message driven approach (see ProcessManager section). Prooph/service-bus was used for handling messages (commands, domain events).
Inspired by:
- Modeling complex processes and time with Saga pattern talk by Mariusz Gil performed on 2017.phpce conference
- Saga on sagas section from a book "Exploring CQRS and Event Sourcing"
- broadway/broadway-saga nice repo with saga implementation
Requirements
non-docker:
- PHP 7.1 or later, composer
docker:
Installation (non-docker):
-
git clone [email protected]:lzakrzewski/prooph-saga-playground.git
-
cd prooph-saga-playground && composer install
Usage
non-docker:
-
bin/console prooph:saga:playground
docker:
-
make playground
(with docker installation step might be skipped)
Example output
ProcessManager
It can handle two scenarios. When everything is fine then OrderProcessManager
dispatches OrderConfirmed
event and process ends. If there is not enough seats available then OrderProcessManager
dispatches AddSeatsToWaitList
command.