json_rpc

Extracts JSON-RPC 2.0 envelope metadata from request bodies and promotes method, id, and kind to request headers and filter results for routing.
On this page

Extracts JSON-RPC 2.0 envelope metadata from request bodies and promotes method, id, and kind to request headers and filter results for routing.

Configuration Notes

Message kinds: request, notification, response, batch.

Writes json_rpc.* entries to the filter result set for branch chain conditions.

Configuration

FieldTypeRequiredDescription
batch_policyreject | firstnoBatch handling policy (default: [reject]). Controls whether JSON-RPC batch arrays are allowed. See [BatchPolicy] for security implications.
headersJsonRpcHeadersnoHeader names for metadata promotion.
headers.idstringnoHeader name for JSON-RPC id (e.g., X-Json-Rpc-Id).
headers.kindstringnoHeader name for JSON-RPC kind (e.g., X-Json-Rpc-Kind).
headers.methodstringnoHeader name for JSON-RPC method (e.g., X-Json-Rpc-Method).
max_batch_sizeintegernoMaximum number of items allowed in a JSON-RPC batch array. Only enforced when [batch_policy] is [First]. Requests exceeding this limit are rejected with HTTP 400. This prevents a single HTTP request from multiplexing an excessive number of JSON-RPC calls, which could bypass per-request rate limits. Under [First] this value is also how many batch item captures the parser retains while deserializing the body, so it bounds peak parse memory as well as the accepted batch length: raising it raises both. Under [Reject] nothing is retained and the value has no effect at all. Default: [DEFAULT_MAX_BATCH_SIZE] (100). Must be between 1 and [MAX_BATCH_SIZE] (10,000).
max_body_bytesintegernoMaximum body size in bytes for StreamBuffer.
on_invalidcontinue | reject | errornoInvalid input handling behavior.

Examples

Example 1

filter: json_rpc

Example 2

filter: json_rpc
max_body_bytes: 1048576
batch_policy: first
max_batch_size: 50
on_invalid: continue
headers:
  method: X-Json-Rpc-Method
  id: X-Json-Rpc-Id
  kind: X-Json-Rpc-Kind