diff --git a/pulsar-testclient/src/main/java/org/apache/pulsar/proxy/socket/client/PerformanceClient.java b/pulsar-testclient/src/main/java/org/apache/pulsar/proxy/socket/client/PerformanceClient.java index 531918e81d91e..107791b32b2dd 100644 --- a/pulsar-testclient/src/main/java/org/apache/pulsar/proxy/socket/client/PerformanceClient.java +++ b/pulsar-testclient/src/main/java/org/apache/pulsar/proxy/socket/client/PerformanceClient.java @@ -36,9 +36,11 @@ import java.util.concurrent.atomic.LongAdder; import org.apache.commons.lang3.StringUtils; +import org.apache.pulsar.broker.service.Topic; import org.apache.pulsar.client.api.Authentication; import org.apache.pulsar.client.api.AuthenticationDataProvider; import org.apache.pulsar.client.api.AuthenticationFactory; +import org.apache.pulsar.common.naming.TopicName; import org.apache.pulsar.testclient.utils.PaddingDecimalFormat; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -166,7 +168,9 @@ public void runPerformanceTest(long messages, long limit, int numOfTopic, int si String topicName, String authPluginClassName, String authParams) throws InterruptedException, FileNotFoundException { ExecutorService executor = Executors.newCachedThreadPool(new DefaultThreadFactory("pulsar-perf-producer-exec")); HashMap producersMap = new HashMap<>(); - String produceBaseEndPoint = baseUrl + "ws/producer" + topicName; + String restPath = TopicName.get(topicName).getRestPath(); + String produceBaseEndPoint = TopicName.get(topicName).isV2() ? + baseUrl + "ws/v2/producer/" + restPath : baseUrl + "ws/producer/" + restPath; for (int i = 0; i < numOfTopic; i++) { String topic = numOfTopic > 1 ? produceBaseEndPoint + String.valueOf(i) : produceBaseEndPoint; URI produceUri = URI.create(topic);