[fix][doc] Correct loadConf example key in PulsarAdminBuilder#25556
Conversation
|
good catch |
The loadConf Javadoc example used serviceHttpUrl as the config map key, but PulsarAdminBuilder.loadConf maps the entries through ClientConfigurationData, whose corresponding field is named serviceUrl. Copy-pasting the example as-is would produce a silently ignored configuration entry. Change the example key to serviceUrl to match the actual configuration field, and change the example URL scheme to pulsar:// so the example reflects a real broker service URL (per @merlimat's review). Fixes apache#24093
c64107e to
7836370
Compare
|
Thanks for the clarification @dao-jun — you're right, I kept the example in this PR as // Any scheme accepted by PulsarAdmin is fine; e.g.
// config.put("serviceUrl", "pulsar://localhost:6650");
// config.put("serviceUrl", "http://localhost:8080");if you think documenting both schemes in the Javadoc would be clearer for users landing on |
No need to keep them both, this is just an example. |

Fixes #24093
Motivation
PulsarAdminBuilder.loadConfdocuments an example that usesserviceHttpUrlas the config map key:However,
loadConfresolves its keys againstClientConfigurationData, whose field is declared asserviceUrl:https://github.com/apache/pulsar/blob/master/pulsar-client/src/main/java/org/apache/pulsar/client/impl/conf/ClientConfigurationData.java#L60-L65
Copy-pasting the current example produces a silently ignored configuration entry and no admin service URL is set, which is a frustrating first-contact experience for anyone reading the API docs.
Modifications
pulsar-client-admin-api/.../PulsarAdminBuilder.java: change theloadConfexample key fromserviceHttpUrltoserviceUrl.Verifying this change
This change is a trivial Javadoc-only fix without any test coverage.
Does this pull request potentially affect one of the following parts:
None of the listed areas are affected. This is a comment-only change inside a Javadoc example.
Documentation
doc-not-neededNo user-facing documentation outside of this Javadoc example needs updating; the admin configuration reference already uses the correct
serviceUrlkey.