1. Proxies and Flow

for

Version

Iterates over a collection and runs its nested flow once per element. The in expression is evaluated against the exchange and must yield a List; for each item the nested plugins run with the current item exposed as the exchange property it. Iteration happens only in the request flow and only when the expression yields a list; any other value passes through unchanged. If the expression fails to evaluate, the exchange is aborted with a Problem Details response. See the examples and tutorials under examples/orchestration and tutorials/orchestration.
 for:
   in: expression                # must evaluate to a List
   [ language: SpEL | groovy | jsonpath | xpath ]   # default: SpEL
   flow:                         # runs once per item; current item in property "it"
     - ...
 

Example Configuration

api:
port: 2000
flow:
- for:
in: message.json.items
flow:
- log: {}
api:
   port: 2000
   flow:
     - for:
         in: message.json.items
         flow:
           - log: {}

Syntax

for:
in: <string> # required
'$ref': <string>
flow:
- <flow>
language: groovy
for:
  in: <string> # required
  '$ref': <string>
  flow:
    - <flow>
  language: groovy

Attributes

NameRequiredDefaultDescriptionExamples
$reffalse-Reference a component defined under components.-
intrue-Expression that selects the collection to iterate over; it must evaluate to a List.message.json.customers
languagefalseSpELExpression language used to evaluate in.groovy

Child Structure

ElementCardinalityDescription
flow0..*Sets the flow of plugins that will be executed.

Can be used in