eclipse / paho.mqtt.java

Eclipse Paho Java MQTT client library. Paho is an Eclipse IoT project.
https://eclipse.org/paho
Other
2.12k stars 883 forks source link

MQTTv5: Publish Property 3.3.2.3.5 Response Topic allows Wildcards (error) #545

Closed joelcdunn closed 6 years ago

joelcdunn commented 6 years ago

Please fill out the form below before submitting, thank you!

p.58 of MQTTv5 Spec: The Response Topic MUST NOT contain wildcard characters. ...

HOWEVER, They will flow through to the MQTT Server with no error indicated.
example of PUBLISH receive at the MQTT SERVER:

MQTT receive 32 PUBLISH connect=37: len=235 00000: 0024696f 742d322f 6576742f 7075626c 69736850 726f7065 7274792f 666d742f [.$iot-2/evt/publishProperty/fmt/] 00032: 52546f70 69630001 2508001f 696f742d 322f6576 742f7075 626c6973 6850726f [RTopic..%...iot-2/evt/publishPro] 00064: 70657274 792f666d 742f2323 00014d73 6720313a 7b20636c 69656e74 49643d64 [perty/fmt/##..Msg 1:{ clientId=d] 00096: 3a6f7267 34696f74 323a7075 6250726f 70733a52 546f7069 632c2072 65746169 [:org4iot2:pubProps:RTopic, retai] 00128: 6e3a6661 6c73652c 20726573 706f6e73 65546f70 69633a69 6f742d32 2f657674 [n:false, responseTopic:iot-2/evt] 00160: 2f707562 6c697368 50726f70 65727479 2f666d74 2f232c20 516f533a 312c2074 [/publishProperty/fmt/#, QoS:1, t] 00192: 6f706963 3a696f74 2d322f65 76742f70 75626c69 73685072 6f706572 74792f66 [opic:iot-2/evt/publishProperty/f] 00224: 6d742f52 546f7069 63207d [mt/RTopic }]

jpwsutton commented 6 years ago

I've added the Mqtt Topic Validator to check when a response topic is set, so this should now throw an Illegal argument exception if the application attempts to set an invalid response topic. It this fix is now available in the snapshots repository.