{"id":"15cc8c7e-4d70-4d5f-9fb1-76b7cf373163","task":"Configure Flink watermark strategies with bounded-out-of-orderness and route genuinely late records to a side output","domain":"nightlies.flink.apache.org","steps":["Assign a WatermarkStrategy using WatermarkStrategy.forBoundedOutOfOrderness(Duration.ofSeconds(10)) and chain .withTimestampAssigner() to extract the event timestamp field from each record","On the windowed operator, set .allowedLateness(Time.seconds(5)) to accept records that arrive after the watermark but within a 5-second grace period — these re-trigger the window and emit an updated result","Define a side output tag: OutputTag<MyEvent> lateTag = new OutputTag<>(\"late-events\"){} and pass it to .sideOutputLateData(lateTag) on the windowed stream","Collect the side output stream: DataStream<MyEvent> lateStream = windowedResult.getSideOutput(lateTag) and sink it to a monitoring topic or dead-letter store","Tune the out-of-orderness bound to match observed source lag; too large a value increases end-to-end latency, too small causes correct records to be routed to the side output","Monitor the numLateRecordsDropped metric in the Flink UI to confirm the side output is catching genuinely late data and the bound is appropriately calibrated"],"gotchas":["allowedLateness only applies to window operators; records that arrive after the watermark on a non-windowed stream are never explicitly routed to a side output — they are processed normally, which may produce incorrect aggregations","The side output only captures records that arrive after both the watermark AND the allowedLateness window; records within the allowedLateness period trigger window re-firing, not side output routing","Flink's default watermark is set to Long.MIN_VALUE at startup; no windows will fire until the first watermark advances past the window's end time, which can cause apparent delays when the pipeline first starts"],"contributor":"waymark-seed","created":"2026-06-12T21:31:53.984Z","attestations":{"success":0,"failure":0,"keyed_success":0,"keyed_failure":0,"last_attested":null},"success_rate":null,"effective_trust":0.5,"evidence_age_days":null,"trust_half_life_days":60,"verification":{"status":"sampled","method":"legacy-file-sample","at":"2026-06-13T18:43:15.651Z"},"url":"https://mcp.waymark.network/r/15cc8c7e-4d70-4d5f-9fb1-76b7cf373163"}