Chapter 7 of the Symfony for PHP developers track
The messenger raven
6 exercises · 1,570 XP · about 3 h 30 min
MessengerMessage#[AsMessageHandler]MessageBusInterfaceTransportQueuemessenger:consumein-memoryretry_strategyfailure_transportRetriesRedeliveryStampScheduler#[AsSchedule]RecurringMessageScheduled taskTesting messagesIn-memory queueWorkerDebuggingFailure queue
The chapter's exercises
-
The first raven
Exercise 1 · 240 XP · 5 objectives checked by tests
Reservations pour in from the four corners of the kingdom, and Gorm forgets half of the confirmations. So the tavern gets itself an aviary: for every reservation, a raven flies off to deliver the confirmation.
MessengerMessage#[AsMessageHandler]MessageBusInterface
-
The raven flies in the background
Exercise 2 · 250 XP · 5 objectives checked by tests
The raven leaves, that's something. But it leaves during the request: the guild's scroll waits for the bird to be prepared, fed and released before getting its answer. And if the aviary is crowded, the guild waits.
TransportQueuemessenger:consumein-memory
-
The raven that gets lost
Exercise 3 · 250 XP · 5 objectives checked by tests
A raven does not always arrive. The winds turn, dark towers scramble the routes… and some lands are simply out of reach.
retry_strategyfailure_transportRetriesRedeliveryStamp
-
The evening raven
Exercise 4 · 250 XP · 5 objectives checked by tests
Every evening, Gorm wants to know what awaits him the next day: how many tables, how many adventurers. Enough to plan the provisions, and the number of barrels.
Scheduler#[AsSchedule]RecurringMessageScheduled task
-
Testing the ravens
Exercise 5 · 260 XP · 5 objectives checked by tests
The aviary works. Now you need to make sure it will still work in six months, when Pippin has “tidied up” the configuration.
Testing messagesIn-memory queueWorker
-
🐉 Boss: the broken aviary
Exercise 6 · 320 XP · 5 objectives checked by tests
Pippin wanted to “optimize the aviary”. Since then, Gorm has been getting complaints: