{"record":{"id":"0d6926c39f0eeda4","repo":"apache/pulsar","slug":"not-implemented-0d6926","errorCode":null,"errorMessage":"not implemented","messagePattern":"not implemented","errorType":"exception","errorClass":"UnsupportedOperationException","httpStatus":null,"severity":"warning","filePath":"pulsar-io/core/src/main/java/org/apache/pulsar/io/core/SinkContext.java","lineNumber":75,"sourceCode":"    /**\n     * Get subscription type used by the source providing data for the sink.\n     *\n     * @return subscription type\n     */\n    default SubscriptionType getSubscriptionType() {\n        throw new UnsupportedOperationException(\"Context does not provide SubscriptionType\");\n    }\n\n    /**\n     * Reset the subscription associated with this topic and partition to a specific message id.\n     *\n     * @param topic - topic name\n     * @param partition - partition id (0 for non-partitioned topics)\n     * @param messageId to reset to\n     * @throws PulsarClientException\n     */\n    default void seek(String topic, int partition, MessageId messageId) throws PulsarClientException {\n        throw new UnsupportedOperationException(\"not implemented\");\n    }\n\n    /**\n     * Stop requesting new messages for given topic and partition until {@link #resume(String topic, int partition)}\n     * is called.\n     *\n     * @param topic - topic name\n     * @param partition - partition id (0 for non-partitioned topics)\n     */\n    default void pause(String topic, int partition) throws PulsarClientException {\n        throw new UnsupportedOperationException(\"not implemented\");\n    }\n\n    /**\n     * Resume requesting messages.\n     * @param topic - topic name\n     * @param partition - partition id (0 for non-partitioned topics)\n     */","sourceCodeStart":57,"sourceCodeEnd":93,"githubUrl":"https://github.com/apache/pulsar/blob/820761864ed8e2a7d2e52dd9763ad2ae117c1395/pulsar-io/core/src/main/java/org/apache/pulsar/io/core/SinkContext.java#L57-L93","documentation":"SinkContext.seek(topic, partition, messageId) is a default method throwing UnsupportedOperationException('not implemented') because the base interface does not implement repositioning the subscription to a specific MessageId. Only concrete runtime contexts that implement seek will work; otherwise any call fails.","triggerScenarios":"Calling sinkContext.seek(\"topic\", 0, messageId) in a sink whose runtime SinkContext implementation does not override seek (or running in an environment without seek support).","commonSituations":"Sink connectors implementing replay/rewind logic; tests using stub contexts; older Pulsar worker versions predating seek support on SinkContext.","solutions":["Upgrade the Pulsar functions runtime to a version where SinkContext.seek is implemented.","Wrap the call in try-catch for UnsupportedOperationException and degrade gracefully (skip repositioning, log).","Use a PulsarClient Consumer.seek directly if the sink has access to a client and topic instead of relying on SinkContext.","In tests, stub seek to record the call."],"exampleFix":"// before\nctx.seek(topic, partition, msgId);\n// after\ntry {\n    ctx.seek(topic, partition, msgId);\n} catch (UnsupportedOperationException e) {\n    log.warn(\"seek not supported by this context; skipping reset to {}\", msgId);\n}","handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"try {\n    ctx.seek(topic, partition, messageId);\n} catch (UnsupportedOperationException e) {\n    log.warn(\"SinkContext.seek unsupported; skipping reposition to {}\", messageId);\n}","preventionTips":["Feature-detect seek support once at init and cache the result","Provide an alternative replay path via PulsarClient consumer seek when available","Upgrade to a runtime version implementing seek before relying on it"],"tags":["pulsar-io","unsupported-operation","seek","sink-context"],"backgroundTag":"method-not-implemented","analyzedSha":"820761864ed8e2a7d2e52dd9763ad2ae117c1395","analyzedAt":"2026-09-06T00:14:20.138Z","contentChangedAt":"2026-09-06T00:14:20.138Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}