A CQRS Approach with Api Platform and Symfony Messenger
summary
A concrete CQRS implementation using Api Platform for the read side and Symfony Messenger for commands, with two endpoints: POST for user registration and GET for user retrieval. Commands are dispatched to a Messenger command bus and persisted via a Doctrine transport so they run asynchronously; the code includes a custom DataProvider for queries, command handlers, middleware to enforce transactional handlers, and decorator-based validation. The uploader reports this implementation is running in production.
AI-written summary · about
chapters (18)
- 0:00Introduction
- 3:42What is CQRS and why
- 8:51Api Platform as framework
- 10:19Symfony Messenger async
- 11:48Example project structure
- 14:02Read flow with CQRS
- 21:48Query handling and providers
- 27:37Write flow with commands
- 31:56Async vs sync commands
- 35:30Command error handling
- 40:28Middleware and transactions
- 44:24CQRS pros and cons
- 46:39Summary
- 47:25Q&A
- 50:57Q&A
- 53:26Q&A
- 55:38Q&A
- 57:05Closing
related talks
54mFrom domain to code: a practical approach
39mMastering message Queues
44mAn Introduction to Symfony Messenger
41mSymfony Messenger: Queues, Workers and Much More!
02h 05mSymfony Messenger
53mHigh Quality APIs with API Platform
44mSymfony Messenger: Messages, Queues, Workers and more
43mAsync with Messenger, AMQP and Mercure
