Skip to content
This repository was archived by the owner on Nov 16, 2026. It is now read-only.

Support tenant and namespace - #206

Merged
jiazhai merged 13 commits into
streamnative:masterfrom
BewareMyPower:bewaremypower/support-tenant-ns
Oct 29, 2020
Merged

jiazhai merged 13 commits into
streamnative:masterfrom
BewareMyPower:bewaremypower/support-tenant-ns

Conversation

@BewareMyPower

@BewareMyPower BewareMyPower commented Oct 27, 2020 •

Copy link
Copy Markdown
Contributor

Currently KoP only support produce or consume topics in the configured namespace by kafkaTenant and kafkaNamespace. If we want to make use of Pulsar's multi-tenancy, we need to enable SASL authentication and encode the namespace info into the sasl.jaas.config property.

This PR is to use Pulsar topic name as Kafka topic name, the topic mapping from topic in Kafka client to the real Pulsar topic is:

  • my-topic => persistent://<kafkaTenant>/<kafkaNamespace>/my-topic
  • my-tenant/my-ns/my-topic => persistent://my-tenant/my-ns/my-topic

This work is done by the new added KopTopic.

Besides, if client want to fetch the metadata of all topics, before this PR, only the topics of <kafkaTenant>/<kafkaNamespace> would be returned, now the topics of all namespaces would be returned.

Following unit tests are added:

  • KopTopicTest: test the basic functions of KopTopic;
  • DifferentNamespaceTest: test the newly supported topic name version to specify a custom namespace

@BewareMyPower

BewareMyPower commented Oct 27, 2020 •

Copy link
Copy Markdown
Contributor Author

Mark the PR as WIP because the unit test failure of PublishRateLimitTest#testBrokerPublishByteThrottling and KafkaRequestTypeTest.testPulsarProduceKafkaConsume2 need to be solved.

Besides, a unit test for topics in different namespaces needs to be added.

@BewareMyPower BewareMyPower changed the title Support tenant and namespace [WIP] Support tenant and namespace Oct 27, 2020
@BewareMyPower BewareMyPower changed the title [WIP] Support tenant and namespace Support tenant and namespace Oct 28, 2020
@BewareMyPower
BewareMyPower force-pushed the bewaremypower/support-tenant-ns branch from 6b8d485 to 6f5e591 Compare October 28, 2020 15:34
@jiazhai

jiazhai commented Oct 28, 2020

Copy link
Copy Markdown
Contributor

overall looks good, left some comments.
We should also change the documents

@BewareMyPower

Copy link
Copy Markdown
Contributor Author

overall looks good, left some comments.
We should also change the documents

There's one point that the configuration and authentication docs are both in StreamNative website, which is recorded in the private repository. Should we also add some docs to this repository?

@jiazhai

jiazhai commented Oct 28, 2020

Copy link
Copy Markdown
Contributor

overall looks good, left some comments.
We should also change the documents

There's one point that the configuration and authentication docs are both in StreamNative website, which is recorded in the private repository. Should we also add some docs to this repository?

there were README.md and DEVELOP.md in this repo. once this is added, we could change the repo of StreamNative website

@BewareMyPower

Copy link
Copy Markdown
Contributor Author

Changes have been done, PTAL, @jiazhai

@jiazhai
jiazhai merged commit 04b6164 into streamnative:master Oct 29, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants