Multi-Tenancy

Topic Naming Rule

Pulsar supports multi-tenancy. The client side should specifies a long topic name URL like "persistent://tenant/ns/topic". KSN leverages the multi-tenancy from Pulsar and keeps the compatibility with the short topic names in Kafka.

For Kafka client users, they should follow the topic naming rule in this section. Otherwise, unexpected behaviors might happen.

You should specific topic names like:

  • topic: Okay, it refers the topic persistent://public/default/topic in the public/default namespace.
  • tenant/ns/topic: Okay, it refers the topic persistent://tenant/ns/topic in the tenant/ns namespace.

You should not use topic names like:

  • public/default/topic: The default namespace prefix should not be used
  • persistent://public/default/topic: The persistent:// prefix and the default namespace should not be used
  • persistent://tenant/ns/topic: The persistent:// prefix should not be used

In short, use a short topic name if you don't care about multi-tenancy. Otherwise, add the namespace prefix for topics in non-default namespaces.

Listing topics

By default, when listing topics via Kafka clients or Kafka CLI, only topics in the default namespace will be listed. This behavior is intended to avoid accessing other namespaces that you might not have permission to access.

If you want to list topics in some other namespaces (e.g. tenant1/ns1 and tenant2/ns2), you can use Pulsar admin CLI to update the configuration dynamically:

./bin/pulsar-admin brokers update-dynamic-config --config kopAllowedNamespaces --value "tenant1/ns1,tenant2/ns2"
Previous
Kafka Compatibility