moscajs / mosca

MQTT broker as a module
mosca.io
3.2k stars 513 forks source link

Add option 'qos2Puback' - if set to true, will modify published messages to … #639

Closed btsimonh closed 7 years ago

btsimonh commented 7 years ago

Add option 'qos2Puback' - if set to true, will modify published qos 2 messages to qos 1 before processing. This results in the messages getting a puback, which fools mqtt.js into not getting stuck when sending qos 2 to mosca. It's an option because the spec does not allow for this? Probably will not suit all clients, but better than mqtt.js dying; a patch over the issue until mosca can get true QOS-2 or QOS-2 pseudo-processing.

btsimonh commented 7 years ago

ok, all done on this one I think.

mcollina commented 7 years ago

can you rebase? this is conflicting with your other PR?

btsimonh commented 7 years ago

yep, will try to clean up. Was a bit of a job to merge because the code moves existing code, confusing the auto-merge; but maybe I can fool it.

btsimonh commented 7 years ago

I'll just make a new PR from my existing 'btsimonh-dev', where I already merged both in. Tested merge from there on Sourcetree, and all was automagic...