Skip to content

Commit

Permalink
Remove redundant parameter totalMessages (apache#4583)
Browse files Browse the repository at this point in the history
Remove redundant parameter ```totalMessages``` for publish method.
  • Loading branch information
liketic authored and sijie committed Jun 29, 2019
1 parent 5de6e6b commit 7a24136
Showing 1 changed file with 4 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,6 @@
import com.fasterxml.jackson.core.JsonProcessingException;
import com.google.common.collect.Lists;
import com.google.common.util.concurrent.RateLimiter;
import com.google.gson.Gson;
import com.google.gson.JsonObject;
import com.google.gson.JsonParseException;

import java.net.URI;
Expand All @@ -37,7 +35,6 @@
import java.util.Map;
import java.util.concurrent.CompletableFuture;
import java.util.concurrent.CountDownLatch;
import java.util.concurrent.Future;
import java.util.concurrent.TimeUnit;

import org.apache.commons.lang3.StringUtils;
Expand Down Expand Up @@ -164,13 +161,13 @@ public int run() throws PulsarClientException {
String topic = this.mainOptions.get(0);

if (this.serviceURL.startsWith("ws")) {
return publishToWebSocket(totalMessages, topic);
return publishToWebSocket(topic);
} else {
return publish(totalMessages, topic);
return publish(topic);
}
}

private int publish(int totalMessages, String topic) {
private int publish(String topic) {
int numMessagesSent = 0;
int returnCode = 0;

Expand Down Expand Up @@ -203,7 +200,7 @@ private int publish(int totalMessages, String topic) {
}

@SuppressWarnings("deprecation")
private int publishToWebSocket(int totalMessages, String topic) {
private int publishToWebSocket(String topic) {
int numMessagesSent = 0;
int returnCode = 0;

Expand Down

0 comments on commit 7a24136

Please sign in to comment.