eclipse-paho / eclipse-paho/paho.mqtt.java
Mqttv5 client should throw MqttException if pubAck/pubRec is received with reason code >= 0x80
- Dominant language
- Java
- Stars
- 2.3k
- Forks
- 919
- PR merge metrics
- No merged PRs in 30d
Description
Mqttv5 client when receives PubAck with reason code 131 (Implementation specific error) does not throw MqttException to notify the application developer that publish has failed.
```
20260625 075641.251 org.eclipse.paho.mqttv5.client.wire.MqttInputStream readMqttWireMessage Pub33: Received MqttPubAck [returnCode=131, properties=MqttProperties [validProperties=[31, 38]]]
20260625 075641.251 org.eclipse.paho.mqttv5.client.internal.ClientState notifyReceivedAck Pub33: received key=1 message=MqttPubAck [returnCode=131, properties=MqttProperties [validProperties=[31, 38]]]
20260625 075641.251 org.eclipse.paho.mqttv5.client.internal.Token markComplete Pub33: >key=1 response=MqttPubAck [returnCode=131, properties=MqttProperties [validProperties=[31, 38]]] excep=null
20260625 075641.251 org.eclipse.paho.mqttv5.client.internal.Token notifyComplete Pub33: >key=1 response=MqttPubAck [returnCode=131, properties=MqttProperties [validProperties=[31, 38]]] excep=null
20260625 075641.251 org.eclipse.paho.mqttv5.client.internal.ClientState notifyResult Pub33: key1, msg=MqttPubAck [returnCode=131, properties=MqttProperties [validProperties=[31, 38]]], excep=null
20260625 075641.251 org.eclipse.paho.mqttv5.client.internal.Token waitForResponse Pub33: key=1 response=MqttPubAck [returnCode=131, properties=MqttProperties [validProperties=[31, 38]]]
20260625 075641.251 org.eclipse.paho.mqttv5.client.internal.CommsCallback asyncOperationComplete Pub33: new workAvailable. key=1
20260625 075641.252 org.eclipse.paho.mqttv5.client.internal.CommsReceiver run Pub33: network read message
20260625 075641.252 org.eclipse.paho.mqttv5.client.internal.CommsCallback handleActionComplete Pub33: callback and notify for key=1
20260625 075641.252 org.eclipse.paho.mqttv5.client.internal.ClientState notifyComplete Pub33: received key=1 token=org.eclipse.paho.mqttv5.client.MqttToken@56e8b606 message=MqttPubAck [returnCode=131, properties=MqttProperties [validProperties=[31, 38]]]
20260625 075641.252 org.eclipse.paho.mqttv5.client.internal.ClientState decrementInFlight Pub33: -1 actualInFlight=0
20260625 075641.252 org.eclipse.paho.mqttv5.client.internal.ClientState get Pub33: new work or ping arrived
20260625 075641.252 org.eclipse.paho.mqttv5.client.internal.CommsTokenStore removeToken Pub33: key=1
20260625 075641.252 org.eclipse.paho.mqttv5.client.internal.ClientState notifyComplete Pub33: removed Qos 1 publish. key=1
20260625 075641.252 org.eclipse.paho.mqttv5.client.internal.ClientState get Pub33: wait for new work or for space in the inflight window
20260625 075641.252 org.eclipse.paho.mqttv5.client.internal.Token notifyComplete Pub33: >key=1 response=MqttPubAck [returnCode=131, properties=MqttProperties [validProperties=[31, 38]]] excep=null
20260625 075641.252 org.eclipse.paho.mqttv5.client.internal.CommsCallback run Pub33: notify spaceAvailable
20260625 075641.252 org.eclipse.paho.mqttv5.client.internal.CommsCallback run Pub33: wait for workAvailable
```
Contributor guide
Research direction
Start at ClientState.notifyReceivedAck and trace how MqttPubAck and PubRec responses flow through Token and CommsCallback. Reproduce the reason-code 131 case and add coverage for reason codes >= 0x80, including both PubAck and PubRec; done means the publish operation reports an MqttException instead of completing with excep=null.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- networking
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 58/100