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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to