This project is a demo from the presentation of Hugo Monteiro at SymfonyWorld Winter edition 2021:
"Decoupling your application using Symfony Messenger and events"
composer install
bin/console doctrine:migrations:migrate
bin/console doctrine:fixtures:load
// create a customer, car and reservation and cancel it
bin/console app:rentcar:simulation -vvv
// get domain events from the database (from the stored_event table) and push to the transport (outbox) - infinite loop
bin/console app:domain:events:publish -vvv
// consume domain events in another handler using the transport
bin/console messenger:consume async
Note: The transport configured is the doctrine one, so the sqlite database will be used by default.
bin/phpunit -c phpunit.xml.dist
- Domain events in a table "stored_event" after executing the "simulation" command
- Aggregate roots in their tables (e.g. customer, reservation, etc)
- Worker that sends the domain events from the database to the transport configured
- Use Symfony Messenger consume command to consume domain events published
- API with all the handler actions and API tests
- Create more tests to cover all invariants