Skip to main content
版本:v2.0.0

HTTP API Reference

Audience: application developers integrating with the EventMesh traffic port directly (any language, no SDK required). Every endpoint below lives on the traffic HTTP port (default 10105) and is registered in UniHttpServer. The Java SDK wraps all of these — see the Java client guide.


Conventions

  • Events are CloudEvents 1.0 JSON; Content-Type: application/cloudevents+json (structured mode) on writes.
  • Success codes: 200 (data) / 202 (accepted, durably in the WAL).
  • Error shape: {"error": "<machine>", "message": "<human>"} with the appropriate 4xx/5xx.
  • If a SecurityGate is installed, every call passes it first: 401 unauthenticated, 403 forbidden, 429 quota exceeded — see Security.
  • Oversized payloads are rejected 413 up front.

Core pub/sub

EndpointMethodRequestResponse
/events/publish?topic=XPOSTCloudEvent JSON body202
/events/publish-batch?topic=XPOSTJSON array of CloudEvents202
/events/subscribePOST{"clientId","topic","mode"}200 {subscriptionId, instanceUrl}
/events/unsubscribePOST{"clientId","topic"?}200 {removed: bool}
/events/poll?clientId=C&timeoutMs=N&max=MGET200 [{deliveryId, event}, …]
/events/ackPOST{"deliveryId"}200 {status:"acked"} / 404 unknown

modeLOAD_BALANCE | BROADCAST | MULTICAST (see Publish & subscribe). instanceUrl is the load-balancer-pinned instance for subsequent polls (empty when no advertised address is configured).

Request-reply

EndpointMethodRequestResponse
/events/requestPOSTCloudEvent (reply correlated on emcorrelationid)200 reply CloudEvent / 408 timeout
/events/replyPOSTCloudEvent with emcorrelationid extension202

Streaming push

EndpointMethodNotes
/events/stream?clientId=CGET (SSE)text/event-stream; server pushes data: <CloudEvent JSON> frames

WebSocket push uses a separate port (-Deventmesh.ws.port, WS upgrade) — see Streaming.

Lite Topic (RocketMQ 5.x only)

EndpointMethodRequest
/events/lite/createPOSTparent topic + lite queue definition
/events/lite/publish / publish-bytesPOSTevent (JSON / raw bytes) to a lite queue
/events/lite/poll / poll-bytesGETclientId + lite queue

See Lite Topic.

Agent control plane (v2 sessions)

EndpointMethodPurpose
/agent/registerPOSTRegister an agent
/agent/readyPOSTFlip readiness
/agent/heartbeatPOSTKeep-alive
/agent/unregisterPOSTDeregister
/session/open / /session/closePOSTOpen/close a streaming session
/session/recommendPOSTAsk the runtime which instance should own a session (sticky)
/session/streamGETSession SSE stream
/session/publish / /session/subscribePOSTMode-2 session pub/sub

The session layer is not auto-wired in the default bootstrap — an embedder enables it via builders (see Deployment → deployment modes).

A2A gateway (separate port, Experimental)

/a2a/tasks* — task submission, status, SSE streaming. Runs on its own listener (A2AGatewayServer), not the traffic port. See A2A protocol.

Legacy bridge

EndpointPurpose
/eventmesh/publish, /eventmesh/subscribe, /eventmesh/unsubscribeOld-SDK compatibility (MeshMessage envelope); adapted onto the same frame path

New integrations should use /events/* + CloudEvents — see Protocols & SDKs for the migration path.