apache/pulsar · warning · UnsupportedOperationException
not implemented
Error message
not implemented
What it means
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.
Source
Thrown at pulsar-io/core/src/main/java/org/apache/pulsar/io/core/SinkContext.java:75
/**
* Get subscription type used by the source providing data for the sink.
*
* @return subscription type
*/
default SubscriptionType getSubscriptionType() {
throw new UnsupportedOperationException("Context does not provide SubscriptionType");
}
/**
* Reset the subscription associated with this topic and partition to a specific message id.
*
* @param topic - topic name
* @param partition - partition id (0 for non-partitioned topics)
* @param messageId to reset to
* @throws PulsarClientException
*/
default void seek(String topic, int partition, MessageId messageId) throws PulsarClientException {
throw new UnsupportedOperationException("not implemented");
}
/**
* Stop requesting new messages for given topic and partition until {@link #resume(String topic, int partition)}
* is called.
*
* @param topic - topic name
* @param partition - partition id (0 for non-partitioned topics)
*/
default void pause(String topic, int partition) throws PulsarClientException {
throw new UnsupportedOperationException("not implemented");
}
/**
* Resume requesting messages.
* @param topic - topic name
* @param partition - partition id (0 for non-partitioned topics)
*/View on GitHub (pinned to 820761864e)
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.
Example fix
// before
ctx.seek(topic, partition, msgId);
// after
try {
ctx.seek(topic, partition, msgId);
} catch (UnsupportedOperationException e) {
log.warn("seek not supported by this context; skipping reset to {}", msgId);
} Defensive patterns
Strategy: try-catch
Try / catch
try {
ctx.seek(topic, partition, messageId);
} catch (UnsupportedOperationException e) {
log.warn("SinkContext.seek unsupported; skipping reposition to {}", messageId);
} Prevention
- 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
When it happens
Trigger: 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).
Common situations: Sink connectors implementing replay/rewind logic; tests using stub contexts; older Pulsar worker versions predating seek support on SinkContext.
Related errors
- Context does not provide SubscriptionType
- BookKeeper client is not available
- Package Management Service is not enabled in the broker.
- Expire message by timestamp is not supported for non-persist
- Expire message by position is not supported for non-persiste
AI-assisted analysis of apache/pulsar@820761864e (2026-09-06).
Data as JSON: /api/errors/0d6926c39f0eeda4.
Report an issue: GitHub.