eclipse-paho / eclipse-paho/paho.mqtt.java
Manual Ack confirmation cannot meet expectations
- Dominant language
- Java
- Stars
- 2.3k
- Forks
- 919
- PR merge metrics
- No merged PRs in 30d
Description
- [x] Bug exists Release Version 1.2.5 ( Master Branch)
- [ ] Bug exists in MQTTv3 Client on Snapshot Version 1.2.6-SNAPSHOT (Develop Branch)
- [ ] Bug exists in MQTTv5 Client on Snapshot Version 1.2.6-SNAPSHOT (Develop Branch)
"I tried to set manual Ack in the MQTT client (Client.setManualAcks), and set the callback function deliveryComplete before publish handling to process the ack confirmation messages. Before subscribing to subscribe("test/#", 2), I also set the Callback function, messageArrived to receive data, and let the thread wait 30 seconds, manually confirm ack (Client.messageArrivedComplete(mqttMessage.getId(), 1);). However, in my final test, when the publishing is completed and the receiving end finishes printing the data, deliveryComplete has received the completion confirmation."
In summary, you:
Enabled manual ack in MQTT client using setManualAcks()
Set callback deliveryComplete to handle ACKs
Set callback messageArrived to receive data
Wait 30 seconds in messageArrived before manually acking
But observed that deliveryComplete gets called immediately after data is printed, not waiting 30 seconds.
Please let me know if you need any clarification or have additional questions!
Contributor guide
Research direction
Start by reproducing the reported sequence with Client.setManualAcks, deliveryComplete, messageArrived, and messageArrivedComplete(mqttMessage.getId(), 1), using the MQTT client versions identified in the issue. Trace when deliveryComplete is invoked relative to the 30-second wait and manual acknowledgement. Done means the observed confirmation timing matches the documented manual-ack expectations, with a regression test if the project provides a suitable test location.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- networking
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100