liveBook · Manning

Parallelism

As explained in Spring AI in Action

Parallelization is a technique that executes multiple processing paths concurrently and aggregates their results.

Parallelization sends one input through two or more processing paths concurrently, then aggregates their results. In an agent workflow, it answers several related questions at once before a final summarizer produces one response. section 12.2.3 section 12.1

A Spring implementation uses:

  • A ParallelizerAction that receives injected worker actions. section 12.2.3
  • CompletableFuture and a fixed thread pool to execute workers independently without blocking each other. section 12.2.3
  • Aggregation into one dashed-separated String, followed by a SummarizerAction. section 12.2.3
  • A Chain configuration that runs rule retrieval, parallel analysis, and summarization in sequence. section 12.2.3

Board-game question answering

For a question about Azul, one worker determines the player count while another determines game mechanics. Their results are combined and summarized into a single answer. section 12.2.3

Figure 12.3 Performing actions in parallel
figure

Use the workflow figure to see how one input branches into parallel actions before converging on summarization. section 12.2.3

How Spring AI in Action covers it

How deep it goes
Implements worker execution, thread-pool sizing, result aggregation, summarization, and Spring workflow wiring.
Examples
Demonstrates Azul analysis by running player-count and game-mechanics actions before summarizing their outputs.
What it assumes
Assumes action-based workers and a chain workflow, then assembles them through dependency injection.
What you can do after
Apply it via Java CompletableFuture, executor services, injected actions, and Spring bean configuration.
How it connects
Connects parallelization to agentic workflows, chain workflows, worker actions, and summarization.

Also explained in

Compare how 38 books explain parallelism →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Spring AI in Action. The section links point to the parts of the book it draws on.