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

Impact of connecting to broker which supports MQTT 5.0 specification #715

Open jayjamba opened 4 years ago

jayjamba commented 4 years ago

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

If this is a bug regarding the Android Service, please raise the bug here instead: https://github.com/eclipse/paho.mqtt.android/issues/new

Hi, I am connecting to VerneMQ latest version (which supports MQTT 5.0 specs) through Eclipse paho java client 1.2.1 version. I need to know what can be the adverse impact of connecting to vernemq which supports MQTT 5.0 specs and paho doesn't support 5.0 specs. Coz the shared subscription feature (the feature which I care for) on VerneMQ is anyways working fine, which I tested it. Do I need to take some special care while connecting to VerneMQ OR Do I need to wait till Paho java client for MQTT 5.0 specs is released ?

Below is the code through which I am connecting to VerneMQ: public MqttClient getClient(final String clientId) throws MqttException { final MqttClient mqttClient = new MqttClient("192.168.0.1", clientId); final MqttConnectOptions connectOptions = new MqttConnectOptions(); connectOptions.setCleanSession(false); connectOptions.setAutomaticReconnect(true); connectOptions.setServerURIs(new String[] { "192.168.0.1", "192.168.0.2", "192.168.0.3" }); mqttClient.connect(connectOptions); return mqttClient; }

jayjamba commented 4 years ago

Hi, Did you get a chance to look into this ?

jayjamba commented 4 years ago

Hi, Is anyone looking into this ?

xranby commented 4 years ago

I am able to connect to a VerneMQ server using the paho MQTTv5 client.

Please note that the VerneMQ server administrator need to enable the 5 protocol as only 3 and 4 are enabled by default. listener.tcp.allowed_protocol_versions = 3,4,5

https://vernemq.com/intro/mqtt-primer/mqtt5_getting_started.html

You can see my paho MQTTv5 example code that can connect and subscribe to a topic on a VerneMQ MQTTv5 server. https://github.com/eclipse/paho.mqtt.java/issues/787