Skip to content

Configurations

Moleculer / NATS RPC

The [nats_moleculer] section controls communication between the platform and Moleculer modules.

[nats_moleculer]
enable = true
request_timeout_ms = 5000
max_outbound_requests = 8
max_inbound_requests = 8
Parameter Description
request_timeout_ms Maximum duration of one RPC request in milliseconds.
max_outbound_requests Maximum number of simultaneous platform-to-module RPC calls.
max_inbound_requests Maximum number of simultaneous module-to-platform RPC calls.
max_concurrent_requests Legacy fallback used for either direction when the corresponding direction-specific parameter is absent.

The limits are not derived from the platform worker-pool size. This makes the configured values effective on small CPU instances as well as on larger hosts. Values are clamped to the supported range 1..64.

When an outbound limit is reached, the platform returns HTTP/TCP status 503 with a diagnostic payload:

{
  "error": "MOL_CALL_LIMIT",
  "message": "Moleculer outbound concurrency limit reached: active=8 limit=8",
  "direction": "outbound",
  "active": 8,
  "limit": 8
}

Inbound Moleculer errors use the same code and include direction, active, and limit in the Moleculer error object.