Skip to content

Commit 72ab8fa

Browse files
committed
pub: each user stick to his topic
1 parent 8dc23c2 commit 72ab8fa

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

mqtt_jmeter/src/main/java/net/xmeter/samplers/ConnectionSampler.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ public void testEnded(String arg0) {
134134
@Override
135135
public void testStarted() {
136136
keepTime = Integer.parseInt(getConnKeepTime());
137-
logger.info("Keeptime is: " + keepTime);
137+
logger.info("*** Keeptime is: " + keepTime);
138138
}
139139

140140
@Override

mqtt_jmeter/src/main/java/net/xmeter/samplers/PubSampler.java

+4-2
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ public class PubSampler extends AbstractMQTTSampler implements ThreadListener {
2929
private String payload = null;
3030
private String clientId = "";
3131
private QoS qos_enum = QoS.AT_MOST_ONCE;
32+
private String topicName = "";
3233

3334
public String getQOS() {
3435
return getPropertyAsString(QOS_LEVEL, String.valueOf(QOS_0));
@@ -117,6 +118,9 @@ public SampleResult sample(Entry arg0) {
117118
payload = Util.generatePayload(Integer.parseInt(getMessageLength()));
118119
}
119120

121+
topicName = getTopic();
122+
logger.info("*** topicName=" + topicName);
123+
120124
int qos = Integer.parseInt(getQOS());
121125
switch (qos) {
122126
case 0:
@@ -143,8 +147,6 @@ public SampleResult sample(Entry arg0) {
143147
SampleResult result = new SampleResult();
144148
result.setSampleLabel(getName());
145149
try {
146-
String topicName = getTopic();
147-
148150
byte[] toSend = new byte[]{};
149151
byte[] tmp = new byte[]{};
150152

0 commit comments

Comments
 (0)