Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,6 @@
import org.apache.pulsar.client.admin.PulsarAdminException;
import org.apache.pulsar.client.api.schema.GenericRecord;
import org.apache.pulsar.client.impl.BatchMessageIdImpl;
import org.apache.pulsar.client.impl.ClientBuilderImpl;
import org.apache.pulsar.client.impl.ConsumerBase;
import org.apache.pulsar.client.impl.ConsumerImpl;
import org.apache.pulsar.client.impl.MessageIdImpl;
Expand Down Expand Up @@ -4868,7 +4867,7 @@ public void testClientVersion() throws Exception {
assertEquals(stats.getPublishers().size(), 1);
assertEquals(stats.getPublishers().get(0).getClientVersion(), defaultClientVersion);

PulsarClient client = ((ClientBuilderImpl) PulsarClient.builder())
PulsarClient client = PulsarClient.builder()
.description("my-java-client")
.serviceUrl(lookupUrl.toString())
.build();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -717,4 +717,21 @@ ClientBuilder authentication(String authPluginClassName, Map<String, String> aut
* - The `loadManagerClassName` config in broker is a class that implements the `ExtensibleLoadManager` interface
*/
ClientBuilder lookupProperties(Map<String, String> properties);

/**
* 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
*/
ClientBuilder description(String description);
}
Original file line number Diff line number Diff line change
Expand Up @@ -477,21 +477,7 @@ public ClientBuilder autoCertRefreshSeconds(int autoCertRefreshSeconds) {
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
*/
@Override
public ClientBuilder description(String description) {
if (description != null && description.length() > 64) {
throw new IllegalArgumentException("description should be at most 64 characters");
Expand Down
Loading