Enable or disable WASM body matching. When enabled, users can upload WebAssembly modules as custom body matchers. WASM modules run inside a pure-Java interpreter (chicory) and are sandboxed from the host. See WASM Custom Rules for details.
Type: boolean Default: false
Java Code:
ConfigurationProperties.wasmEnabled(boolean enable)
System Property:
-Dmockserver.wasmEnabled=...
Environment Variable:
MOCKSERVER_WASM_ENABLED=...
Property File:
mockserver.wasmEnabled=...
Example:
-Dmockserver.wasmEnabled="true"
Maximum number of WASM linear memory pages allowed per module. Each page is 64 KiB, so the default of 256 pages allows up to 16 MiB of linear memory per WASM module. Increase this if your WASM modules need to process large request bodies.
Type: int Default: 256
Java Code:
ConfigurationProperties.wasmMaxMemoryPages(int pages)
System Property:
-Dmockserver.wasmMaxMemoryPages=...
Environment Variable:
MOCKSERVER_WASM_MAX_MEMORY_PAGES=...
Property File:
mockserver.wasmMaxMemoryPages=...
Example:
-Dmockserver.wasmMaxMemoryPages="512"
Maximum time in milliseconds a single WASM module invocation is allowed to run before it is aborted. WASM rules are evaluated while MockServer is matching a request, so a module containing an infinite loop would otherwise occupy that thread indefinitely and can eventually stop MockServer serving requests at all.
A module that exceeds the limit is aborted and treated as not matching, so a runaway rule fails safe rather than blocking. The default of 5000 (5 seconds) is far longer than any normal rule needs. Set it to 0 to disable the limit and restore the previous unbounded behaviour.
Type: long Default: 5000
Java Code:
ConfigurationProperties.wasmExecutionTimeoutMillis(long timeoutMillis)
System Property:
-Dmockserver.wasmExecutionTimeoutMillis=...
Environment Variable:
MOCKSERVER_WASM_EXECUTION_TIMEOUT_MILLIS=...
Property File:
mockserver.wasmExecutionTimeoutMillis=...
Example:
-Dmockserver.wasmExecutionTimeoutMillis="1000"