Real-time message handling and notifications
summary
Builds an admin dashboard for an online casino that pushes suspicious-activity alerts in real time using API Platform, Symfony Messenger, Mercure. Implements Mercure Hub (Docker or FrankenPHP), JWT-based publish/subscribe claims, static and dynamic topics, and EventSource subscriptions with cookie auth; API Platform’s mcy=true flag auto-publishes Doctrine changes and Messenger dispatching makes updates async. Benchmarks suggest up to ~5x faster processing with a parallel bus prototype; full flow (publish → hub → connected clients) is demonstrated working.
AI-written summary · about
chapters (23)
- 0:00Introduction
- 0:48Real-time basics
- 2:14HTTP protocol evolution
- 5:06HTTP limitations for real time
- 5:48Polling vs long polling
- 7:14Server-Sent Events
- 8:18WebSockets overview
- 10:05Other real-time protocols
- 11:06Introducing Mercury protocol
- 12:50Mercury setup
- 14:37Mercury with Symfony
- 17:51Subscribing to updates
- 18:54Publishing updates
- 23:08Topics and permissions
- 24:13Asynchronous updates
- 25:59Handling complex updates
- 27:48Concurrent message processing
- 30:41Client-side subscriptions
- 33:10Authorization methods
- 35:41Event Source management
- 36:43Active subscriptions API
- 37:47Mercury benefits summary
- 38:08Closing remarks
