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
- PHP 7.1 or later, composer
git clone git@github.com:lzakrzewski/prooph-saga-playground.git
cd prooph-saga-playground && composer install
bin/console prooph:saga:playground
make playground
(with docker installation step might be skipped)
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.