eclipse / mosquitto

Eclipse Mosquitto - An open source MQTT broker
https://mosquitto.org
Other
8.87k stars 2.36k forks source link

MQTT 5 support for bridges #1292

Open Johann-Angeli opened 5 years ago

Johann-Angeli commented 5 years ago

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

ralight commented 5 years ago

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

Johann-Angeli commented 5 years ago

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

ralight commented 5 years ago

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.