emqx / mqtt-jmeter

MQTT JMeter Plugin
https://www.emqx.com/en
Apache License 2.0
445 stars 194 forks source link

exception in mqtt sub sampler #132

Open AnunayaThakureb opened 1 year ago

AnunayaThakureb commented 1 year ago

When I try to use the mqtt sub sampler it throws an exception and after digging it throws an exception in the below function

private String decode(ByteBuffer value) {
    try {
        return decoder.get().decode(value).toString();
    } catch (CharacterCodingException e) {
        throw new RuntimeException(new MQTTClientException("Failed to decode", e));
    }
}

and the exception is Caused by: net.xmeter.samplers.mqtt.MQTTClientException: Failed to decode at net.xmeter.samplers.mqtt.hivemq.HiveMQTTConnection.decode(HiveMQTTConnection.java:117) ~[mqtt-xmeter-2.0.2-jar-with-dependencies.jar:?] at java.util.Optional.map(Optional.java:215) ~[?:1.8.0_312] at net.xmeter.samplers.mqtt.hivemq.HiveMQTTConnection.handlePublishReceived(HiveMQTTConnection.java:109) ~[mqtt-xmeter-2.0.2-jar-with-dependencies.jar:?] at com.hivemq.client.internal.mqtt.mqtt3.Mqtt3AsyncClientView.lambda$callbackView$1(Mqtt3AsyncClientView.java:73) ~[mqtt-xmeter-2.0.2-jar-with-dependencies.jar:?] at com.hivemq.client.internal.mqtt.MqttAsyncClient$CallbackSubscriber.onNext(MqttAsyncClient.java:227) ~[mqtt-xmeter-2.0.2-jar-with-dependencies.jar:?] at com.hivemq.client.internal.mqtt.MqttAsyncClient$CallbackSubscriber.onNext(MqttAsyncClient.java:212) ~[mqtt-xmeter-2.0.2-jar-with-dependencies.jar:?] at com.hivemq.client.rx.FlowableWithSingle$SingleFutureSubscriber.onNext(FlowableWithSingle.java:377) ~[mqtt-xmeter-2.0.2-jar-with-dependencies.jar:?] at com.hivemq.client.internal.rx.operators.FlowableWithSingleCombine$SplitSubscriber$Default.tryOnNextActual(FlowableWithSingleCombine.java:206) ~[mqtt-xmeter-2.0.2-jar-with-dependencies.jar:?] at com.hivemq.client.internal.rx.operators.FlowableWithSingleCombine$SplitSubscriber.tryOnNext(FlowableWithSingleCombine.java:171) ~[mqtt-xmeter-2.0.2-jar-with-dependencies.jar:?] at io.reactivex.internal.operators.flowable.FlowableObserveOn$ObserveOnConditionalSubscriber.runAsync(FlowableObserveOn.java:649) ~[mqtt-xmeter-2.0.2-jar-with-dependencies.jar:?] at io.reactivex.internal.operators.flowable.FlowableObserveOn$BaseObserveOnSubscriber.run(FlowableObserveOn.java:176) ~[mqtt-xmeter-2.0.2-jar-with-dependencies.jar:?] at io.reactivex.internal.schedulers.ScheduledRunnable.run(ScheduledRunnable.java:66) ~[mqtt-xmeter-2.0.2-jar-with-dependencies.jar:?]

Please help.