Examples¶
Two end-to-end walkthroughs showing how the actor model, durable state, and ingress/egress fit together for non-trivial systems.
Pick whichever is closer to what you're building:
-
Per-card risk scoring on a payments stream. Velocity checks, geo-impossibility detection, delayed re-evaluation. Shows actors that decay state over time and emit alerts only on threshold breach.
-
Per-device twins for industrial telemetry. Rolling sensor stats, battery degradation alerts, command/response loop. Shows long-lived actors, command emission back to devices, and offline-detection via timers.
What both examples have in common¶
- One actor per logical id — one card, one device. Per-instance state, isolated by Flink's keyed-state.
- Durable state survives restart — RocksDB + S3 checkpoints; if the cluster failovers, state is recovered.
- Exactly-once messaging — Kafka transactions + Flink checkpointing; no duplicate alerts on replay.
- Polyglot remote functions — the function logic is Java in these examples but could be Python, Go, or JS over the same HTTP wire protocol.
What you'll see in each example¶
- Problem framing — the concrete business signal each system has to detect
- Architecture diagram — Mermaid flow of the pipeline
- Protobuf message types — wire format
StatefulFunctionimplementation — Java with annotations explaining each stepmodule.yamlwiring — ingress, egress, function endpoint- Local testing — how to send a synthetic event and verify the response
- Production scaling notes — partitioning, hot-key handling, throughput targets
Next steps¶
- Quickstart — round-trip a message in five minutes before diving in.
- Architecture overview — the runtime model that powers both examples.
- Kafka I/O guide — full ingress/egress reference.