Skip to main content

Record Many Mode

The runner can be started in RecordMany mode by setting the WMC_DEFAULT_MODE environment variable to RecordMany. This mode starts a multi-domain recording session as the Runner starts up and will continue to record until the runner is stopped.

Record Many Configuration

The record many session started by the Runner can be configured via the same mechanism as the WireMock ClI - either via a values file or via environment variables. More information on the configuration options can be found in the WireMock CLI documentation. Just like the WireMock CLI, by default the Runner will expect a WireMock environment file in the .wiremock directory in the current working directory of the container.

Flushing Recordings

The RecordMany 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 in RecordMany 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:
docker run \
  -e WMC_DEFAULT_MODE='RecordMany' \
  -e WMC_ADMIN_PORT='9999' \
  -e WMC_API_TOKEN='<wmc-api-token>' \
  -p 9999:9999 \
  -p 8080:8080 \
  -p 8081:8081 \
  wiremock/wiremock-runner:latest
I