JVM functions are hosted by the ingestor runtime
Status
Section titled “Status”Accepted and built. It supersedes the earlier plan for a standalone JVM runner installed with the development tool.
2026-10-31.
Context
Section titled “Context”Functions written for the JVM (a jar, not Wasm) need a host. The first plan was a standalone JVM runner with its own install step. At the same time the platform already has a Java 25 service, the ingestor runtime, built on the framework’s HTTP server with virtual threads. It already authenticates to the platform, holds client credentials and is started by the development tool.
A separate runner would duplicate a control-plane client, authentication, an HTTP listener and an operations story for a second Java process.
Decision
Section titled “Decision”JVM functions are served by the ingestor runtime as a second role next to ingestion.
- Role switches.
INGEST_FUNCTIONS_ENABLED(default true) turns the function role on;INGEST_FUNCTIONS_POOLnames the pool the process serves; ingestion has its own switch. A deployment can run either role or both. A function-only process takes no ingestion leases. Whether production runs the roles in one deployment or two is a later, configuration-only choice: one artifact, two roles. - Same contract as other runners. The host speaks the platform’s function control protocol (desired state, heartbeat with capabilities, artifacts, events, dispatch jobs) and serves
/fn/{address}[@{alias}|@v{n}]/{path}with the same status codes as the Go runner. Its service account also holds theplatform:function-runnerrole. - Runtime tag
jvm, fixed per function. A function’s first version sets it; changing it later is refused asRUNTIME_MISMATCH. Pool, warm instances and limits are platform settings, as for Wasm functions, not part of the jar. - Describe without executing. The platform reads
META-INF/flowcatalyst/function.jsonfrom the jar without running anything, under size caps (64 MiB artifact, 1 MiB describe, 50,000 entries), and requires ajvm.entrypoint. - Concurrent by design. One loaded instance per version serves every call at once, each on its own virtual thread. Only the per-function permit count and the host cap limit concurrency; nothing serialises calls of one function. Exhausted permits answer 429 at once rather than queueing.
- Class loading. A function sees the JDK, the function API and the framework (with the Jackson it exposes); it bundles everything else. This is fault isolation, not a sandbox, in line with ADR 0030.
- Copied, not redesigned. The function API and host were adapted from an existing Java function host, changing only what this platform’s API needs (two-label addresses, the platform’s request and caller types, a dispatcher, the platform’s webhook conventions).
Consequences
Section titled “Consequences”Good:
- No new product to build, install or operate; local development gets JVM functions by default because the development tool already starts the ingestor.
- JVM functions reach databases (through one shared connection pool per distinct DSN), HTTP, events and dispatch with the same declarations as other runtimes.
- Scaling out is a deployment decision, not a code change.
Bad:
- Functions and ingestion share a process unless split, so a misbehaving function can affect ingestion in a combined deployment. Operators who care should run the roles separately.
- Public routes and domains for functions are not built, and per-function metrics and a role-specific readiness check are still missing.
- The request body cap of the server applies to every function whatever its own limit says.
- A PEM database key in a DSN is passed to the driver unconverted.
Alternatives considered
Section titled “Alternatives considered”| Alternative | Why not |
|---|---|
| A standalone JVM runner with its own install command | Duplicates the control-plane client, authentication and listener already in the ingestor. |
| Serialise calls per function instance | Throws away the JVM’s strength; concurrency is the reason to use it. |
| Run JVM functions inside the Go platform process | Not possible without embedding a JVM. |
| Redesign the function API from scratch | Slower, and the borrowed design was already proven. |