Record Many Mode
One of the Runner’s available modes isrecord-many mode.
The runner can be started in record-many mode by setting the WMC_DEFAULT_MODE environment variable to record-many,
or switched to this mode using the Runner’s switch endpoint.
This mode starts a multi-domain recording session that will continue to record until the
runner is stopped or its mode is switched.
Record Many Configuration
The record many session started by the Runner can be configured via the same mechanism as therecord-many command
of the WireMock CLI - either via a values file or via environment variables.
Additionally, configuration can be provided at switch time via the HTTP request body.
All options available to the record-many CLI command are also available to the Runner’s record-many mode.
When specifying an option in the "config" field of the HTTP switch request, remove the dash (-) prefix that would normally be used when provided on the command line.
For instance, the --include-services option would become "include-services" in the request body, like so:
.wiremock directory
in the current working directory of the container.
Flushing Recordings
Therecord-many mode will honour the batching configuration you
have specified in your config file. The Runner also defines an endpoint which can be used to flush the recorded requests
to WireMock Cloud independently of the batching configuration:
POST /v1/record-many/flush
Starting the Runner In Record Many Mode
When starting the runner inrecord-many mode you will need to publish the appropriate ports
for the services you are running along with the port you have configured for the Runner.
Here is a typical example on Linux or macOS when running the Runner on port 9999 and recording to two Mock APIs: