{"record":{"id":"cc12b531ec4782b2","repo":"apache/beam","slug":"solaceio-write-unboundedsolacewriter-context-boundedwindow","errorCode":null,"errorMessage":"SolaceIO.Write.UnboundedSolaceWriter.Context: BoundedWindow is required for a FinishBundleContext.","messagePattern":"SolaceIO\\.Write\\.UnboundedSolaceWriter\\.Context: BoundedWindow is required for a FinishBundleContext\\.","errorType":"exception","errorClass":"IllegalStateException","httpStatus":null,"severity":"error","filePath":"sdks/java/io/solace/src/main/java/org/apache/beam/sdk/io/solace/write/UnboundedSolaceWriter.java","lineNumber":362,"sourceCode":"      beamContextWrapper.finishBundleContext = finishBundleContext;\n      return beamContextWrapper;\n    }\n\n    public <T> void output(\n        TupleTag<T> tag,\n        T output,\n        @Nullable Instant timestamp, // Not required for windowed context\n        @Nullable BoundedWindow window) { // Not required for windowed context\n      if (windowedContext != null) {\n        windowedContext.output(tag, output);\n      } else if (finishBundleContext != null) {\n        if (timestamp == null) {\n          throw new IllegalStateException(\n              \"SolaceIO.Write.UnboundedSolaceWriter.Context: Timestamp is required for a\"\n                  + \" FinishBundleContext.\");\n        }\n        if (window == null) {\n          throw new IllegalStateException(\n              \"SolaceIO.Write.UnboundedSolaceWriter.Context: BoundedWindow is required for a\"\n                  + \" FinishBundleContext.\");\n        }\n        finishBundleContext.output(tag, output, timestamp, window);\n      } else {\n        throw new IllegalStateException(\n            \"SolaceIO.Write.UnboundedSolaceWriter.Context: No context provided\");\n      }\n    }\n  }\n}\n","sourceCodeStart":344,"sourceCodeEnd":374,"githubUrl":"https://github.com/apache/beam/blob/12126d8942aaf848030c478b4c6a28c6af861c66/sdks/java/io/solace/src/main/java/org/apache/beam/sdk/io/solace/write/UnboundedSolaceWriter.java#L344-L374","documentation":"UnboundedSolaceWriter.Context.output throws this IllegalStateException when emitting via a FinishBundleContext without a BoundedWindow. FinishBundleContext.output requires both an explicit timestamp and window; a null window means the emitting code path didn't supply the window of the element being output.","triggerScenarios":"Calling Context.output(tag, output, timestamp, null) with finishBundleContext active (windowedContext null) — publishResults or a subclass emitting results without a window during finishBundle.","commonSituations":"Custom writer subclasses that drop the window when collecting results during the bundle; windowed pipelines where results were gathered outside their window context; internal connector bug after a Beam core API change.","solutions":["Ensure the emitting code captures and passes the element's BoundedWindow (e.g. IntervalWindow from the ProcessContext) to context.output in finishBundle.","If you subclass the writer, store the window alongside buffered results when they're first received, then pass it on output.","For global-window pipelines, pass the GlobalWindow instance explicitly rather than null.","Check the Beam version for known connector issues with window propagation in finishBundle."],"exampleFix":"// before\ncontext.output(tag, result, timestamp, null); // window lost\n// after\ncontext.output(tag, result, timestamp, window); // window captured from ProcessContext.window()","handlingStrategy":"validation","validationCode":"if (finishBundleContext != null && window == null) {\n  throw new IllegalStateException(\"finishBundle output requires a non-null BoundedWindow\");\n}","typeGuard":null,"tryCatchPattern":"try { context.output(tag, results, ts, window); } catch (IllegalStateException e) { if (e.getMessage().contains(\"BoundedWindow is required\")) { /* capture window from ProcessContext */ } throw e; }","preventionTips":["Capture the element's BoundedWindow when results are buffered, not at emit time","Use GlobalWindow.INSTANCE for global-window pipelines","Avoid overriding finishBundle without preserving window metadata"],"tags":["solace","java","beam","writer","window"],"backgroundTag":"missing-required-argument","analyzedSha":"12126d8942aaf848030c478b4c6a28c6af861c66","analyzedAt":"2026-09-13T01:50:10.254Z","contentChangedAt":"2026-09-13T01:50:10.254Z","schemaVersion":2},"datasetVersion":"2026-09-14T16:17:12.679Z"}