BewareMyPower commented on code in PR #20009:
URL: https://github.com/apache/pulsar/pull/20009#discussion_r1161626720
##########
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:
I checked `null` value here. And if it's `null`, I'd like not to throw an
exception because `null` means there is no description and then the default
version string will be used.
##########
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:
Added.
--
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]