Skip to content
Ameen Abozaid
Planned lessonMID-006-L06

Demo: fan-out to three services with a deadline

  • Lesson 6 of 6
  • Mid-level
On This Lesson 3 topics

This lesson is planned. The outline below lists the topics it will cover. The full lesson has not been published yet.

In this lesson

aggregate product, stock, and reviews with a deadline; prepares MID-006-LAB1.

Draft outline details

Step by step

  1. Create three simulated clients with delays 100, 150, and 400 ms using a dedicated ioPool.
  2. Start all three, combine with thenCombine; measure total about 400 ms, not 650.
  3. Make reviews fail; add exceptionally for an empty list and a degraded flag.
  4. Add completeOnTimeout of 300 ms for reviews; show partial results.
  5. Planned mistake: call .join() inside a thenApply on the common pool, then run many requests and watch throughput stall. Fix: compose futures (thenCombine/thenCompose) and join only at the end.
  6. Print timings per scenario.

Practice

Apply this lesson with the module's lab, exercises and quiz.

Lab and exercises Quiz

Marking a lesson complete is optional and you can undo it any time. Your progress stays in this browser.

Type to search levels, phases, modules and lessons.