Skip to content

Commit

Permalink
Copy topic and message before release the latch, else the receiver co…
Browse files Browse the repository at this point in the history
…uld read null values
  • Loading branch information
andsel committed Nov 23, 2024
1 parent ead2edd commit 27f8699
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -58,9 +58,9 @@ static class PublishCollector implements IMqttMessageListener {

@Override
public void messageArrived(String topic, MqttMessage message) throws Exception {
latch.countDown();
receivedTopic = topic;
receivedMessage = message;
latch.countDown();
}

public String receivedPayload() {
Expand Down

0 comments on commit 27f8699

Please sign in to comment.