apache / apache/pulsar

[Doc] controlled-failover Optimize example code

Open
#23,512 4 comments 0 reactions 1 assignee Claimed by @visxu View on GitHub
doc-required good first issue
Dominant language
Java
Stars
15.3k
Forks
3.8k
Avg merge
1d 14h
Merged PRs (30d)
160

Description

### Search before asking

- [X] I searched in the [issues](https://github.com/apache/pulsar/issues) and found nothing similar.

### What issue do you find in Pulsar docs?

https://pulsar.apache.org/docs/3.0.x/client-libraries-cluster-level-failover/#controlled-failover
There is unnecessary code present
![image](https://github.com/user-attachments/assets/33ce2f8d-8bfa-44e4-9f97-558a71ea32ff)
![image](https://github.com/user-attachments/assets/3844c552-d3e9-41e1-9ae2-f2bb07886277)

because org.apache.pulsar.client.impl.ClientBuilderImpl#build already initialize
![image](https://github.com/user-attachments/assets/355f274f-c8cb-4d38-a175-b6d4e61a6b2c)

### What is your suggestion?

delete provider.initialize(pulsarClient);
![image](https://github.com/user-attachments/assets/79976742-1f7c-4070-8106-80b349801bc5)

### Any reference?

_No response_

### Are you willing to submit a PR?

- [ ] I'm willing to submit a PR!

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.