hivemq-mqtt-client
hivemq-mqtt-client copied to clipboard
How to Handle Timeouts While Publishing a Message
Expected behavior
I didn't know how to report it but I can't find in the documentation how to set up a timeout while publishing a message. Here, it's described while consuming messages but what about publishing?
So far, I've been using the Mqtt5BlockingClient
:
client = builder.buildBlocking();
client.connect();
client.toAsync()
.subscribeWith()
.topicFilter(topic)
.qos(qos)
.callback(consumer)
.send()
.get();
// ...
client.publishWith()
.topic(messageTopic)
.payload(payload)
.qos(messageQOS)
.messageExpiryInterval(messageExpirySeconds)
.send();
In this process, how can I attach a timeout, please?
Actual behavior
To Reproduce
Steps
Reproducer code
Details
- Affected HiveMQ MQTT Client version(s):
- Used JVM version:
- Used OS (name and version):
- Used MQTT version:
- Used MQTT broker (name and version):
Sorry for the delay, I will still answer here in the next few days, but unfortunately did not find the time in the last weeks.
Hey @SgtSilvio, thanks for your answer. Any news, please?
@teivah @SgtSilvio Did you figure out a method to specify a publish timeout? We are facing similar issue.
I have the same question for MQTT3. I can't find anywhere how to set it.