kite~/kite/docs
v0.2.1
Guide

Multi-Sink Fan-out

Route one event stream to multiple sinks — proxy to an HTTP endpoint and archive to a log at the same time.

A single kite.json manifest targets one sink. To deliver the same events to more than one destination, run more than one Kite process — either several manifests, or a mix of kite run --manifest and one-off kite proxy / kite stream commands.

Each process subscribes independently. Use a stable --client-id to identify long-running subscribers in logs and future cursor-aware delivery paths.

// 01Pattern 1: proxy + archive

Deliver GitHub events to your local app and persist a full CloudEvent JSON log in parallel.

bash
# Terminal 1 — HTTP delivery to your service
kite proxy --source github --target http://localhost:3000/webhooks \
  --client-id app

# Terminal 2 — append-only archive
kite stream --source github --json --client-id archive >> events.ndjson

Each invocation runs as its own subscriber. A restart of one does not affect the other.

// 02Pattern 2: per-source routing with kite proxy --route

kite proxy --route lets a single process fan different sources out to different local endpoints without needing a manifest.

bash
kite proxy \
  --route 'github=http://localhost:3000/github' \
  --route 'stripe=http://localhost:3000/billing' \
  --route 'linear=http://localhost:3000/ops'

// 03Pattern 3: multiple manifests

When each destination needs its own filters, enrichment, or scoring, give each one a manifest.

bash
kite run --manifest ./app.kite.json &
kite run --manifest ./archive.kite.json &
kite run --manifest ./mcp.kite.json &
wait

app.kite.json could proxy to an HTTP service, archive.kite.json could exec a shell logger, and mcp.kite.json could expose events via the mcp_server sink for a local agent.

// 04Pattern 4: chain with exec tee

Inside a manifest, the exec sink runs a shell command per event with the CloudEvent JSON on stdin. Use that to write to disk and forward in a single stage.

json
{
  "name": "fanout",
  "sink": {
    "type": "exec",
    "command": "tee -a events.ndjson | curl -sS -XPOST -H 'content-type: application/json' --data-binary @- http://localhost:3000/webhooks"
  }
}

// 05See also

  • Manifest Schema — all sink types and their fields
  • Filtering Events — narrow what each process receives