I have a Java MQTTv5 client using Paho library v1.2.6
I am sure that all credential are correct and accurate. I have tried using mosquitto_pub (v2.0.18) and MQTTBox to connect and published to the Azure Iot Hub port 8883 So I assumed I have the correct credential and cert.
I have search through Paho Github and also stackoverflow and it seems to be fix in previous version but yet surface again in later version.
When I use my Java client to connect throws the following errors:
Connection lost (32109) - java.io.EOFException<br/>
at<br/>org.eclipse.paho.mqttv5.client.internal.CommsReceiver.run(CommsReceiver.java:196)<br/>
at java.lang.Thread.run(Thread.java:750)<br/>
Caused by: java.io.EOFException<br/>
at java.io.DataInputStream.readByte(DataInputStream.java:267)<br/>
at<br/> org.eclipse.paho.mqttv5.client.wire.MqttInputStream.readMqttWireMessage(MqttInputStream.java:96)<br/>
at<br/> org.eclipse.paho.mqttv5.client.internal.CommsReceiver.run(CommsReceiver.java:139)<br/>
... 1 more<br/>
I have also run debug for the paho
Oct 09, 2024 11:59:01 AM org.eclipse.paho.mqttv5.client.MqttAsyncClient MqttAsyncClient<br/>
FINE: dio: <init> ClientID=dio ServerURI=ssl://mura-iot.azure-devices.net:8883 PersistenceType=org.eclipse.paho.mqttv5.client.persist.MemoryPersistence@6ad21b4b<br/>
Oct 09, 2024 11:59:01 AM org.eclipse.paho.mqttv5.client.internal.CommsTokenStore <Init><br/>
FINE: dio: <><br/>
Oct 09, 2024 11:59:01 AM org.eclipse.paho.mqttv5.client.internal.ClientState <Init><br/>
FINER: dio: <br/>
Oct 09, 2024 11:59:01 AM org.eclipse.paho.mqttv5.client.internal.ClientState restoreState<br/>
FINE: dio: ><br/>
Oct 09, 2024 11:59:01 AM org.eclipse.paho.mqttv5.client.MqttAsyncClient connect<br/>
FINE: dio: cleanStart=true connectionTimeout=300 TimekeepAlive=60 userName=mura-iot.azure-devices.net/dio/?api-version=2021-04-12 password=[notnull] will=[null] userContext=null callback=null<br/>
Oct 09, 2024 11:59:01 AM org.eclipse.paho.mqttv5.client.MqttAsyncClient createNetworkModules<br/>
FINE: dio: URI=ssl://mura-iot.azure-devices.net:8883<br/>
Oct 09, 2024 11:59:01 AM org.eclipse.paho.mqttv5.client.MqttAsyncClient createNetworkModule<br/>
FINE: dio: URI=ssl://mura-iot.azure-devices.net:8883<br/>
Oct 09, 2024 11:59:01 AM org.eclipse.paho.mqttv5.client.MqttAsyncClient createNetworkModules<br/>
FINE: dio: <<br/>
Oct 09, 2024 11:59:01 AM org.eclipse.paho.mqttv5.client.internal.ClientComms connect<br/>
FINE: dio: state=CONNECTING<br/>
Oct 09, 2024 11:59:01 AM org.eclipse.paho.mqttv5.client.internal.CommsTokenStore open<br/>
FINE: dio: ><br/>
Oct 09, 2024 11:59:01 AM org.eclipse.paho.mqttv5.client.internal.Token waitForCompletion<br/>
FINE: dio: key=null wait max=5,000 token=key=null ,topics= ,usercontext=org.eclipse.paho.mqttv5.client.MqttAsyncClient@2d75c9bc ,isComplete=false ,isNotified=false ,exception=null ,actioncallback=org.eclipse.paho.mqttv5.client.internal.ConnectActionListener@f9664ad<br/>
Oct 09, 2024 11:59:01 AM org.eclipse.paho.mqttv5.client.internal.ClientComms connectBG:run<br/>
FINE: dio: ><br/>
Oct 09, 2024 11:59:01 AM org.eclipse.paho.mqttv5.client.internal.CommsTokenStore getOutstandingDelTokens<br/>
FINE: dio: ><br/>
Oct 09, 2024 11:59:01 AM org.eclipse.paho.mqttv5.client.internal.Token waitForResponse<br/>
FINE: dio: >key=null timeout=5,000 sent=false completed=false hasException=false response=null token=key=null ,topics= ,usercontext=org.eclipse.paho.mqttv5.client.MqttAsyncClient@2d75c9bc ,isComplete=false ,isNotified=false ,exception=null ,actioncallback=org.eclipse.paho.mqttv5.client.internal.ConnectActionListener@f9664ad<br/>
Oct 09, 2024 11:59:01 AM org.eclipse.paho.mqttv5.client.internal.CommsTokenStore saveToken<br/>
FINE: dio: key=Con message=MqttConnect [properties=MqttProperties [validProperties=[17, 24, 33, 39, 34, 25, 23, 38, 21, 22]], willProperties=MqttProperties [validProperties=[24, 1, 2, 8, 9, 38, 3]], info=0, clientId=dio, reservedByte=false, cleanStart=true, willMessage=null, userName=mura-iot.azure-devices.net/dio/?api-version=2021-04-12, password=[83, 104, 97, 114, 101, 100, 65, 99, 99, 101, 115, 115, 83, 105, 103, 110, 97, 116, 117, 114, 101, 32, 115, 114, 61, 97, 108, 118, 105, 110, 45, 105, 111, 116, 46, 97, 122, 117, 114, 101, 45, 100, 101, 118, 105, 99, 101, 115, 46, 110, 101, 116, 37, 50, 70, 100, 101, 118, 105, 99, 101, 115, 37, 50, 70, 100, 105, 111, 100, 101, 38, 115, 105, 103, 61, 79, 37, 50, 66, 56, 67, 106, 117, 65, 88, 66, 101, 97, 106, 103, 101, 101, 56, 121, 51, 90, 97, 112, 103, 97, 65, 122, 66, 107, 109, 88, 57, 37, 50, 70, 87, 113, 88, 122, 76, 85, 66, 122, 114, 71, 104, 89, 37, 51, 68, 38, 115, 101, 61, 49, 55, 51, 54, 49, 52, 57, 50, 56, 57], keepAliveInterval=60, willDestination=null, mqttVersion=5]<br/>
Oct 09, 2024 11:59:01 AM org.eclipse.paho.mqttv5.client.internal.Token waitForResponse<br/>
FINE: dio: key=null wait max=5,000<br/>
Oct 09, 2024 11:59:01 AM org.eclipse.paho.mqttv5.client.internal.CommsTokenStore saveToken<br/>
FINE: dio: key=Con token=org.eclipse.paho.mqttv5.client.MqttToken@75bfff01<br/>
Oct 09, 2024 11:59:01 AM org.eclipse.paho.mqttv5.client.internal.TCPNetworkModule start<br/>
FINE: dio: connect to host mura-iot.azure-devices.net port 8,883 timeout 300,000<br/>
Oct 09, 2024 11:59:02 AM org.eclipse.paho.mqttv5.client.internal.CommsReceiver start<br/>
FINE: dio: starting<br/>
Oct 09, 2024 11:59:02 AM org.eclipse.paho.mqttv5.client.internal.CommsReceiver run<br/>
FINE: dio: network read message<br/>
Oct 09, 2024 11:59:02 AM org.eclipse.paho.mqttv5.client.internal.ClientState get<br/>
FINE: dio: wait for new work or for space in the inflight window<br/>
Oct 09, 2024 11:59:03 AM org.eclipse.paho.mqttv5.client.internal.CommsCallback run<br/>
FINE: dio: wait for workAvailable<br/>
Oct 09, 2024 11:59:03 AM org.eclipse.paho.mqttv5.client.internal.ClientComms internalSend<br/>
FINE: dio: 200<br/>
Oct 09, 2024 11:59:03 AM org.eclipse.paho.mqttv5.client.internal.ClientState send<br/>
FINE: dio: pending send key=0 message MqttConnect [properties=MqttProperties [validProperties=[17, 24, 33, 39, 34, 25, 23, 38, 21, 22]], willProperties=MqttProperties [validProperties=[24, 1, 2, 8, 9, 38, 3]], info=0, clientId=dio, reservedByte=false, cleanStart=true, willMessage=null, userName=mura-iot.azure-devices.net/dio/?api-version=2021-04-12, password=[83, 104, 97, 114, 101, 100, 65, 99, 99, 101, 115, 115, 83, 105, 103, 110, 97, 116, 117, 114, 101, 32, 115, 114, 61, 97, 108, 118, 105, 110, 45, 105, 111, 116, 46, 97, 122, 117, 114, 101, 45, 100, 101, 118, 105, 99, 101, 115, 46, 110, 101, 116, 37, 50, 70, 100, 101, 118, 105, 99, 101, 115, 37, 50, 70, 100, 105, 111, 100, 101, 38, 115, 105, 103, 61, 79, 37, 50, 66, 56, 67, 106, 117, 65, 88, 66, 101, 97, 106, 103, 101, 101, 56, 121, 51, 90, 97, 112, 103, 97, 65, 122, 66, 107, 109, 88, 57, 37, 50, 70, 87, 113, 88, 122, 76, 85, 66, 122, 114, 71, 104, 89, 37, 51, 68, 38, 115, 101, 61, 49, 55, 51, 54, 49, 52, 57, 50, 56, 57], keepAliveInterval=60, willDestination=null, mqttVersion=5]<br/>
Oct 09, 2024 11:59:03 AM org.eclipse.paho.mqttv5.client.internal.CommsTokenStore saveToken<br/>
FINE: dio: key=Con message=MqttConnect [properties=MqttProperties [validProperties=[17, 24, 33, 39, 34, 25, 23, 38, 21, 22]], willProperties=MqttProperties [validProperties=[24, 1, 2, 8, 9, 38, 3]], info=0, clientId=dio, reservedByte=false, cleanStart=true, willMessage=null, userName=mura-iot.azure-devices.net/dio/?api-version=2021-04-12, password=[83, 104, 97, 114, 101, 100, 65, 99, 99, 101, 115, 115, 83, 105, 103, 110, 97, 116, 117, 114, 101, 32, 115, 114, 61, 97, 108, 118, 105, 110, 45, 105, 111, 116, 46, 97, 122, 117, 114, 101, 45, 100, 101, 118, 105, 99, 101, 115, 46, 110, 101, 116, 37, 50, 70, 100, 101, 118, 105, 99, 101, 115, 37, 50, 70, 100, 105, 111, 100, 101, 38, 115, 105, 103, 61, 79, 37, 50, 66, 56, 67, 106, 117, 65, 88, 66, 101, 97, 106, 103, 101, 101, 56, 121, 51, 90, 97, 112, 103, 97, 65, 122, 66, 107, 109, 88, 57, 37, 50, 70, 87, 113, 88, 122, 76, 85, 66, 122, 114, 71, 104, 89, 37, 51, 68, 38, 115, 101, 61, 49, 55, 51, 54, 49, 52, 57, 50, 56, 57], keepAliveInterval=60, willDestination=null, mqttVersion=5]<br/>
Oct 09, 2024 11:59:03 AM org.eclipse.paho.mqttv5.client.internal.CommsTokenStore saveToken<br/>
FINE: dio: key=Con token=org.eclipse.paho.mqttv5.client.MqttToken@75bfff01<br/>
Oct 09, 2024 11:59:03 AM org.eclipse.paho.mqttv5.client.internal.ClientState get<br/>
FINE: dio: new work or ping arrived <br/>
Oct 09, 2024 11:59:03 AM org.eclipse.paho.mqttv5.client.internal.CommsSender run<br/>
FINE: dio: network send key=Con msg=MqttConnect [properties=MqttProperties [validProperties=[17, 24, 33, 39, 34, 25, 23, 38, 21, 22]], willProperties=MqttProperties [validProperties=[24, 1, 2, 8, 9, 38, 3]], info=0, clientId=dio, reservedByte=false, cleanStart=true, willMessage=null, userName=mura-iot.azure-devices.net/dio/?api-version=2021-04-12, password=[83, 104, 97, 114, 101, 100, 65, 99, 99, 101, 115, 115, 83, 105, 103, 110, 97, 116, 117, 114, 101, 32, 115, 114, 61, 97, 108, 118, 105, 110, 45, 105, 111, 116, 46, 97, 122, 117, 114, 101, 45, 100, 101, 118, 105, 99, 101, 115, 46, 110, 101, 116, 37, 50, 70, 100, 101, 118, 105, 99, 101, 115, 37, 50, 70, 100, 105, 111, 100, 101, 38, 115, 105, 103, 61, 79, 37, 50, 66, 56, 67, 106, 117, 65, 88, 66, 101, 97, 106, 103, 101, 101, 56, 121, 51, 90, 97, 112, 103, 97, 65, 122, 66, 107, 109, 88, 57, 37, 50, 70, 87, 113, 88, 122, 76, 85, 66, 122, 114, 71, 104, 89, 37, 51, 68, 38, 115, 101, 61, 49, 55, 51, 54, 49, 52, 57, 50, 56, 57], keepAliveInterval=60, willDestination=null, mqttVersion=5]<br/>
Oct 09, 2024 11:59:03 AM org.eclipse.paho.mqttv5.client.internal.ClientState notifySentBytes<br/>
FINE: dio: sent bytes count=14<br/>
Oct 09, 2024 11:59:03 AM org.eclipse.paho.mqttv5.client.internal.ClientState notifySentBytes<br/>
FINE: dio: sent bytes count=207<br/>
Oct 09, 2024 11:59:03 AM org.eclipse.paho.mqttv5.client.wire.MqttOutputStream write<br/>
FINE: dio: Sent MqttConnect [properties=MqttProperties [validProperties=[17, 24, 33, 39, 34, 25, 23, 38, 21, 22]], willProperties=MqttProperties [validProperties=[24, 1, 2, 8, 9, 38, 3]], info=0, clientId=dio, reservedByte=false, cleanStart=true, willMessage=null, userName=mura-iot.azure-devices.net/dio/?api-version=2021-04-12, password=[83, 104, 97, 114, 101, 100, 65, 99, 99, 101, 115, 115, 83, 105, 103, 110, 97, 116, 117, 114, 101, 32, 115, 114, 61, 97, 108, 118, 105, 110, 45, 105, 111, 116, 46, 97, 122, 117, 114, 101, 45, 100, 101, 118, 105, 99, 101, 115, 46, 110, 101, 116, 37, 50, 70, 100, 101, 118, 105, 99, 101, 115, 37, 50, 70, 100, 105, 111, 100, 101, 38, 115, 105, 103, 61, 79, 37, 50, 66, 56, 67, 106, 117, 65, 88, 66, 101, 97, 106, 103, 101, 101, 56, 121, 51, 90, 97, 112, 103, 97, 65, 122, 66, 107, 109, 88, 57, 37, 50, 70, 87, 113, 88, 122, 76, 85, 66, 122, 114, 71, 104, 89, 37, 51, 68, 38, 115, 101, 61, 49, 55, 51, 54, 49, 52, 57, 50, 56, 57], keepAliveInterval=60, willDestination=null, mqttVersion=5]<br/>
Oct 09, 2024 11:59:03 AM org.eclipse.paho.mqttv5.client.internal.ClientState notifySent<br/>
FINE: dio: key=Con<br/>
Oct 09, 2024 11:59:03 AM org.eclipse.paho.mqttv5.client.internal.Token notifySent<br/>
FINE: dio: > key=Con<br/>
Oct 09, 2024 11:59:03 AM org.eclipse.paho.mqttv5.client.internal.ClientState get<br/>
FINE: dio: wait for new work or for space in the inflight window<br/>
Oct 09, 2024 11:59:03 AM org.eclipse.paho.mqttv5.client.internal.CommsReceiver run<br/>
FINE: dio: Stopping due to IOException<br/>
Oct 09, 2024 11:59:03 AM org.eclipse.paho.mqttv5.client.internal.ClientComms shutdownConnection<br/>
FINE: dio: state=DISCONNECTING<br/>
Oct 09, 2024 11:59:03 AM org.eclipse.paho.mqttv5.client.internal.CommsCallback stop<br/>
FINE: dio: stopping<br/>
Oct 09, 2024 11:59:03 AM org.eclipse.paho.mqttv5.client.internal.CommsCallback stop<br/>
FINE: dio: notify workAvailable and wait for run<br/>
Oct 09, 2024 11:59:03 AM org.eclipse.paho.mqttv5.client.internal.CommsCallback stop<br/>
FINE: dio: stopped<br/>
Oct 09, 2024 11:59:03 AM org.eclipse.paho.mqttv5.client.internal.CommsCallback run<br/>
FINE: dio: notify spaceAvailable<br/>
Oct 09, 2024 11:59:03 AM org.eclipse.paho.mqttv5.client.internal.CommsReceiver stop<br/>
FINE: dio: stopping<br/>
Oct 09, 2024 11:59:03 AM org.eclipse.paho.mqttv5.client.internal.CommsReceiver stop<br/>
FINE: dio: stopped<br/>
Oct 09, 2024 11:59:03 AM org.eclipse.paho.mqttv5.client.internal.CommsTokenStore quiesce<br/>
FINE: dio: resp=Client is currently disconnecting (32102)<br/>
Oct 09, 2024 11:59:03 AM org.eclipse.paho.mqttv5.client.internal.ClientComms handleOldTokens<br/>
FINE: dio: ><br/>
Oct 09, 2024 11:59:03 AM org.eclipse.paho.mqttv5.client.internal.ClientState resolveOldTokens<br/>
FINE: dio: reason Connection lost (32109) - java.io.EOFException<br/>
Oct 09, 2024 11:59:03 AM org.eclipse.paho.mqttv5.client.internal.CommsTokenStore getOutstandingTokens<br/>
FINE: dio: ><br/>
Oct 09, 2024 11:59:03 AM org.eclipse.paho.mqttv5.client.internal.CommsTokenStore removeToken<br/>
FINE: dio: key=Con<br/>
Oct 09, 2024 11:59:03 AM org.eclipse.paho.mqttv5.client.internal.ClientState disconnected<br/>
FINE: dio: disconnected<br/>
Oct 09, 2024 11:59:03 AM org.eclipse.paho.mqttv5.client.internal.ClientState clearState<br/>
FINE: dio: ><br/>
Oct 09, 2024 11:59:03 AM org.eclipse.paho.mqttv5.client.internal.CommsTokenStore clear<br/>
FINE: dio: > 0 tokens<br/>
Oct 09, 2024 11:59:03 AM org.eclipse.paho.mqttv5.client.internal.ClientState clearConnectionState<br/>
FINE: dio: Clearing Connection State (Topic Aliases)<br/>
Oct 09, 2024 11:59:03 AM org.eclipse.paho.mqttv5.client.internal.CommsSender stop<br/>
FINE: dio: stopping sender<br/>
Oct 09, 2024 11:59:03 AM org.eclipse.paho.mqttv5.client.internal.ClientState notifyQueueLock<br/>
FINE: dio: notifying queueLock holders<br/>
Oct 09, 2024 11:59:03 AM org.eclipse.paho.mqttv5.client.internal.CommsSender stop<br/>
FINE: dio: stopped<br/>
Oct 09, 2024 11:59:03 AM org.eclipse.paho.mqttv5.client.internal.ClientState get<br/>
FINE: dio: new work or ping arrived <br/>
Oct 09, 2024 11:59:03 AM org.eclipse.paho.mqttv5.client.TimerPingSender stop<br/>
FINE: dio: stop<br/>
Oct 09, 2024 11:59:03 AM org.eclipse.paho.mqttv5.client.internal.ClientState get<br/>
FINE: dio: no outstanding flows and not connected<br/>
Oct 09, 2024 11:59:03 AM org.eclipse.paho.mqttv5.client.internal.ClientComms shutdownConnection<br/>
FINE: dio: state=DISCONNECTED<br/>
Oct 09, 2024 11:59:03 AM org.eclipse.paho.mqttv5.client.internal.CommsSender run<br/>
FINE: dio: get message returned null, stopping}<br/>
Oct 09, 2024 11:59:03 AM org.eclipse.paho.mqttv5.client.internal.CommsCallback handleActionComplete<br/>
FINE: dio: callback and notify for key=Con<br/>
Oct 09, 2024 11:59:03 AM org.eclipse.paho.mqttv5.client.internal.CommsSender run<br/>
FINE: dio: <<br/>
Oct 09, 2024 11:59:03 AM org.eclipse.paho.mqttv5.client.internal.Token notifyComplete<br/>
FINE: dio: >key=Con response=null excep=Connection lost (32109) - java.io.EOFException<br/>
Oct 09, 2024 11:59:03 AM org.eclipse.paho.mqttv5.client.internal.CommsCallback fireActionEvent<br/>
FINE: dio: call onSuccess key=Con<br/>
Oct 09, 2024 11:59:03 AM org.eclipse.paho.mqttv5.client.internal.Token markComplete<br/>
FINE: dio: >key=null response=null excep=Connection lost (32109) - java.io.EOFException<br/>
Oct 09, 2024 11:59:03 AM org.eclipse.paho.mqttv5.client.internal.Token notifyComplete<br/>
FINE: dio: >key=null response=null excep=Connection lost (32109) - java.io.EOFException<br/>
Oct 09, 2024 11:59:03 AM org.eclipse.paho.mqttv5.client.internal.CommsReceiver run<br/>
FINE: dio: <<br/>
Oct 09, 2024 11:59:03 AM org.eclipse.paho.mqttv5.client.internal.Token waitForResponse<br/>
FINE: dio: failed with exception<br/>
Connection lost (32109) - java.io.EOFException<br/>
at org.eclipse.paho.mqttv5.client.internal.CommsReceiver.run(CommsReceiver.java:196)<br/>
at java.lang.Thread.run(Thread.java:750)<br/>
Caused by: java.io.EOFException<br/>
at java.io.DataInputStream.readByte(DataInputStream.java:267)<br/>
at org.eclipse.paho.mqttv5.client.wire.MqttInputStream.readMqttWireMessage(MqttInputStream.java:96)<br/>
at org.eclipse.paho.mqttv5.client.internal.CommsReceiver.run(CommsReceiver.java:139)<br/>
... 1 more<br/>
<br/>
Oct 09, 2024 11:59:03 AM org.eclipse.paho.mqttv5.client.MqttAsyncClient disconnect<br/>
FINE: dio: > quiesceTimeout=5,000 userContext=null callback=null<br/>
Oct 09, 2024 11:59:03 AM org.eclipse.paho.mqttv5.client.internal.ClientComms disconnect<br/>
FINE: dio: failed: already disconnected<br/>
Oct 09, 2024 11:59:03 AM org.eclipse.paho.mqttv5.client.MqttAsyncClient disconnect<br/>
FINE: dio: < exception<br/>
Client is disconnected (32101)<br/>
at org.eclipse.paho.mqttv5.client.internal.ExceptionHelper.createMqttException(ExceptionHelper.java:32)<br/>
at org.eclipse.paho.mqttv5.client.internal.ClientComms.disconnect(ClientComms.java:554)<br/>
at org.eclipse.paho.mqttv5.client.MqttAsyncClient.disconnect(MqttAsyncClient.java:842)<br/>
at org.eclipse.paho.mqttv5.client.MqttAsyncClient.disconnect(MqttAsyncClient.java:818)<br/>
at mqPackage.MQTTConnection.closeConnection(MQTTConnection.java:242)<br/>
at mqPackage.MQTTConnection.connect(MQTTConnection.java:270)<br/>
at mqPackage.MQTTHandler.run(MQTTHandler.java:1016)<br/>
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)<br/>
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)<br/>
at java.lang.Thread.run(Thread.java:750)<br/>
<br/>
Oct 09, 2024 11:59:03 AM org.eclipse.paho.mqttv5.client.MqttAsyncClient close<br/>
FINE: dio: <<br/>
Oct 09, 2024 11:59:03 AM org.eclipse.paho.mqttv5.client.internal.CommsTokenStore clear<br/>
FINE: dio: > 0 tokens<br/>
Oct 09, 2024 11:59:03 AM org.eclipse.paho.mqttv5.client.MqttAsyncClient close<br/>
FINE: dio: ><br/>
I have the following codes:
public void setConOpts() throws Exception {
m_conOpts.setServerURIs(new String[] { m_ip });
if (m_userNameAuth) {
m_conOpts.setUserName(m_username);
m_conOpts.setPassword(m_password.getBytes());
}
m_conOpts.setConnectionTimeout(300);
m_conOpts.setCleanStart(m_setCleanStart);
if (m_trustServerCert || m_validateServerCert || m_twoWaySSL) {
m_conOpts.setSocketFactory(TLS.getSocketFactory(m_trustServerCert, m_validateServerCert, m_serverCertPath, m_twoWaySSL, m_keystorePath, m_keystorePwd));
}
}
I have the following code for connect:
this.v5Client = new MqttAsyncClient(m_ip, m_clientID, m_persistence);
this.v5Client.setCallback(mqH);
IMqttToken connectToken = this.v5Client.connect(m_conOpts);
connectToken.waitForCompletion(actionTimeout);
I have tried taking out most of the connection options but it still didn't work. I am thinking it might be some compatibilities paho mqttv5 to Azure Iot Hub v3.1.1 https://learn.microsoft.com/en-us/azure/iot/iot-mqtt-connect-to-iot-hub
*The username and password in debug log is not the actual one
Paho MQTTv3 library works with Azure Iot Hut therefore I have added Paho MQTTv3 library into the application and toggle between 3 and 5 as needed.