Hi all

### Background
- When calling `pulsarClient.getPartitionsForTopic(topicName)`, Pulsar will
automatically create the partitioned topic metadata if it does not exist,
either using `HttpLookupService` or `BinaryProtoLookupService`.
- The partitioned topic auto-creation is dependent on
`pulsarClient.getPartitionsForTopic`
  - It triggers partitioned metadata creation by
`pulsarClient.getPartitionsForTopic`
  - And triggers the topic partition creation by producers' registration
and consumers' registration.

### Issue
Since the method `pulsarClient.getPartitionsForTopic` is a public API, and
it is named `getxxx,` it should edit nothing.

### Solution
- Solution-1: remove the public API `pulsarClient.getPartitionsForTopic`
and only use it internally.
- Solution-2: provide an internal API to trigger partitioned metadata
creation and make the public API `pulsarClient.getPartitionsForTopic` edit
nothing.
- Solution-3: redesign the flow of partitioned topic auto-creation.

I would like to recommend solution 2, and hope to hear more voices.

Thanks
Yubiao Feng

Reply via email to