You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by "codelipenghui (via GitHub)" <gi...@apache.org> on 2023/04/10 09:33:44 UTC
[GitHub] [pulsar] codelipenghui commented on a diff in pull request #20009: PIP-254: Support configuring client version
codelipenghui commented on code in PR #20009:
URL: https://github.com/apache/pulsar/pull/20009#discussion_r1161581756
##########
pulsar-client/src/main/java/org/apache/pulsar/client/impl/ClientBuilderImpl.java:
##########
@@ -410,4 +410,27 @@ public ClientBuilder socks5ProxyPassword(String socks5ProxyPassword) {
conf.setSocks5ProxyPassword(socks5ProxyPassword);
return this;
}
+
+ /**
+ * Set the description.
+ *
+ * <p> By default, when the client connects to the broker, a version string like "Pulsar-Java-v<x.y.z>" will be
+ * carried and saved by the broker. The client version string could be queried from the topic stats.
+ *
+ * <p> This method provides a way to add more description to a specific PulsarClient instance. If it's configured,
+ * the description will be appended to the original client version string, with '-' as the separator.
+ *
+ * <p>For example, if the client version is 3.0.0, and the description is "forked", the final client version string
+ * will be "Pulsar-Java-v3.0.0-forked".
+ *
+ * @param description the description of the current PulsarClient instance
+ * @throws IllegalArgumentException if the length of description exceeds 64
+ */
+ public ClientBuilder description(String description) {
+ if (description.length() > 64) {
Review Comment:
Should we throw IllegalArgumentException while the description is null or empty?
##########
pulsar-client/src/main/java/org/apache/pulsar/client/impl/conf/ClientConfigurationData.java:
##########
@@ -379,6 +379,12 @@ public class ClientConfigurationData implements Serializable, Cloneable {
@Secret
private String socks5ProxyPassword;
+ @ApiModelProperty(
+ name = "description",
+ value = "The extra description of the client version."
Review Comment:
We should add the maximum length of the description is 64
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org