Theory
Exactly-once is a system property, not a flag
Apache Flink's claim to fame is end-to-end exactly-once processing of streams — even with stateful operators (windowed aggregations, joins, dedup) and even across failures.
The trick is a coordinated distributed snapshot (the Chandy-Lamport algorithm): periodically, a 'checkpoint barrier' flows through the DAG; every operator snapshots its state to durable storage when the barrier arrives. On failure, Flink restores the last completed checkpoint and replays the Kafka offsets from that snapshot — every input is processed exactly once into state.
For end-to-end exactly-once including the sink, the sink must participate in a 2-phase commit (e.g. Kafka transactional producer). Without that, you only have at-least-once delivery to the sink, no matter how strong Flink's internals are.