/prooph-saga-playground

Small CLI application to introduce Saga pattern.

Primary LanguagePHP

prooph-saga-playground

Build Status Scrutinizer Code Quality

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:

Requirements

non-docker:
docker:

Installation (non-docker):

  • git clone git@github.com: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

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.

happy-path:

happy-path

unhappy-path:

unhappy-path