Skip to content

Recipient List

Sometimes one message must reach several receivers, and the set of receivers is not fixed in advance. The Recipient List pattern solves this. It routes a message to a list of dynamically specified recipients.

The pattern belongs to message routing. See the articles Message Routing and Enterprise Integration Patterns for the wider picture.

In Apache Camel. The Recipient List EIP (Enterprise Integration Pattern) takes the list of recipients and forwards the message to all channels tied to those recipients. A channel is the path a message travels to reach a receiver. See Message Channel.

In Scatter-Gather. Scatter-Gather sends a request out to several parties and then collects the answers. See Scatter/Gather. It can use a Recipient List to distribute those requests. This lets Scatter-Gather control which recipients get the request.

An order system must ask for price quotes. The list of suppliers to ask changes from order to order. The system builds a list of suppliers for each order. A router then forwards the quote request to the channel of every supplier on that list.

A router forwards the message to the channel of each recipient on the list.

Diagram source
flowchart LR
S[Sender] --> R[Recipient List router]
R -->|copy| A[Channel of recipient A]
R -->|copy| B[Channel of recipient B]
R -->|copy| C[Channel of recipient C]
  • Where one message must reach a dynamically chosen set of receivers, the document names Recipient List as the routing approach.
  • Where Scatter-Gather is used, the document states whether a Recipient List distributes the requests and so controls the recipients.