{"record":{"id":"59f1109a69679ba4","repo":"apache/pulsar","slug":"v5-does-not-support-non-persistent-topics-to","errorCode":null,"errorMessage":"V5 does not support non-persistent:// topics: + topic","messagePattern":"V5 does not support non-persistent:// topics: \\+ topic","errorType":"exception","errorClass":"UnsupportedOperationException","httpStatus":null,"severity":"error","filePath":"pulsar-client-v5/src/main/java/org/apache/pulsar/client/impl/v5/V5Utils.java","lineNumber":56,"sourceCode":"     * layout (regular topic that has not yet been migrated):\n     * <ul>\n     *   <li>{@code topic://tenant/ns/x} — explicitly scalable.</li>\n     *   <li>{@code persistent://tenant/ns/x} — regular topic; if it has been migrated the\n     *       broker promotes it to its {@code topic://} identity and returns the real DAG,\n     *       otherwise it returns a synthetic layout that wraps the existing partitions.</li>\n     *   <li>Short forms ({@code my-topic} or {@code tenant/ns/my-topic}) — normalised by\n     *       {@link TopicName#get(String)} to {@code persistent://public/default/...} or\n     *       {@code persistent://tenant/ns/...}; treated like any other persistent input.</li>\n     * </ul>\n     *\n     * <p>Rejects {@code non-persistent://} with {@link UnsupportedOperationException}:\n     * scalable topics are always backed by managed ledgers, and the V5 SDK has no path\n     * to a non-persistent topic.\n     */\n    static TopicName parseScalableTopicInput(String topic) {\n        TopicName tn = TopicName.get(topic);\n        if (tn.getDomain() == TopicDomain.non_persistent) {\n            throw new UnsupportedOperationException(\n                    \"V5 does not support non-persistent:// topics: \" + topic);\n        }\n        return tn;\n    }\n}\n","sourceCodeStart":38,"sourceCodeEnd":62,"githubUrl":"https://github.com/apache/pulsar/blob/820761864ed8e2a7d2e52dd9763ad2ae117c1395/pulsar-client-v5/src/main/java/org/apache/pulsar/client/impl/v5/V5Utils.java#L38-L62","documentation":"V5Utils.parseScalableTopicInput validates topic names before the V5 SDK uses them. Scalable topics are always backed by managed ledgers (persistent storage), and the V5 client has no code path for non-persistent topics, so any topic with the non-persistent:// domain is rejected with UnsupportedOperationException.","triggerScenarios":"Calling a V5 SDK API that internally invokes parseScalableTopicInput with a topic string whose domain is 'non-persistent://', e.g. building a producer/consumer/reader on 'non-persistent://tenant/ns/my-topic' via the scalable-topic path.","commonSituations":"Migrating existing Pulsar clients that used non-persistent topics to the V5 SDK; copy-pasting topic URLs that keep the non-persistent:// prefix; configuration where the topic domain is built dynamically and defaults to non_persistent.","solutions":["Change the topic URL to use the persistent:// domain (scalable/V5 topics require managed-ledger-backed persistent topics).","If the topic truly must be non-persistent, keep using the classic (non-V5) Pulsar client, which supports non-persistent topics.","If the domain is constructed dynamically, validate/normalize it before passing the topic to V5 APIs, defaulting to persistent://."],"exampleFix":"// before\nString topic = \"non-persistent://public/default/events\";\nclient.newProducer(V5Config).topic(topic).create();\n// after\nString topic = \"persistent://public/default/events\";\nclient.newProducer(V5Config).topic(topic).create();","handlingStrategy":"validation","validationCode":"if (topic.startsWith(\"non-persistent://\")) {\n    throw new IllegalArgumentException(\"V5 SDK requires persistent topics, got: \" + topic);\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Normalize all topic URLs to persistent:// before constructing V5 clients.","Centralize topic-name construction in one helper that enforces the persistent domain.","Document that non-persistent topics are unsupported in the V5 scalable-topic path."],"tags":["v5-sdk","topic-domain","unsupported-feature","configuration"],"backgroundTag":"unsupported-topic-domain","analyzedSha":"820761864ed8e2a7d2e52dd9763ad2ae117c1395","analyzedAt":"2026-09-06T00:14:20.138Z","contentChangedAt":"2026-09-06T00:14:20.138Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}