Class LoadFeeder


public class LoadFeeder extends ObjectWithJsonToString
Parameterized test data ("data feeder") for a LoadScenario. Per iteration, the orchestrator selects one row from the feeder's dataset and exposes it to that iteration's templated request fields (path, body and headers) via IterationContext.getData() — referenced as $iteration.data.<column> (Velocity) / {{iteration.data.<column>}} (Mustache), exactly the way cross-step captures are referenced through $iteration.captured.<name>.

Dataset, two equivalent forms (source of truth):

  • rows — an inline list of column-to-value maps (the PRIMARY mechanism; JSON-native, round-trips byte-for-byte, no parsing, no I/O surface).
  • data + format — an OPTIONAL raw inline dataset (CSV or JSON) parsed into rows on demand. The raw text is the stored source of truth: it is serialized back verbatim (the derived rows are NOT re-serialized), so a data/format feeder round-trips without double-parsing. CSV parsing reuses CsvTemplateHelper (RFC 4180-ish: handles embedded commas, doubled quotes and newlines; first line = headers). JSON parsing expects an array of objects.
Exactly one form should be supplied. When both are present rows wins (the inline rows are authoritative and data is ignored).

External sources are intentionally out of scope for this version: a feeder cannot fetch from a URL or read an arbitrary file path (that would add an SSRF / arbitrary-file-read surface to a self-load feature). The dataset is always inline in the scenario body. Loading from an external source is a possible future enhancement.

Selection strategy (LoadFeeder.Strategy):

  • CIRCULAR (default) — rows[globalIteration % size]; never exhausts, so sustained load cycles the dataset.
  • RANDOM — a uniformly random row each iteration.
  • SEQUENTIALrows[globalIteration] used exactly once each, in order; the run COMPLETES once the dataset is exhausted (data-driven "replay this dataset once").
See Also: