mosquitto icon indicating copy to clipboard operation
mosquitto copied to clipboard

MQTT 5 support for bridges

Open Johann-Angeli opened this issue 6 years ago • 3 comments

Is it possible to add the support of MQTT 5 with bridges ?

Johann-Angeli avatar May 24 '19 00:05 Johann-Angeli

Yes! I didn't want to delay 1.6 to put it in though.

ralight avatar May 28 '19 15:05 ralight

Great news.

I took a look on the code, and it look like I just have to patch the existing code that load the bridge configuration (see below) for adding the support of the v5 parameter.

see conf.c if(!strcmp(token, "mqttv31")){ cur_bridge->protocol_version = mosq_p_mqtt31; }else if(!strcmp(token, "mqttv311")){ cur_bridge->protocol_version = mosq_p_mqtt311; }else if(!strcmp(token, "mqttv5")){ cur_bridge->protocol_version = mosq_p_mqtt5; }else{ log__printf(NULL, MOSQ_LOG_ERR, "Error: Invalid bridge_protocol_version value (%s).", token); return MOSQ_ERR_INVAL; }

I hope that after this the bridge will act as a standard mqtt client supporting mqtt v5. Can you confirm me that point ?

I would like to test that feature before an official release.

Thks

Johann-Angeli avatar May 28 '19 17:05 Johann-Angeli

Possibly! I feel as though there should be more to it than that though.

I've not got time to look at this right at the moment, so feel free to experiment and report back if you want. Something you could try would be to modify the tests in test/broker/06* to use the new mqttv5 bridge option. That would give us some basic operation at least. Then other changes like modifying subscription options to support the "no local" and "propagate retain" features in MQTTv5 would be needed. At the moment these options are produced in a non standardised way.

ralight avatar May 29 '19 18:05 ralight