Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Paho » mqtts protocol?(Connection issues using mqtts protocol)
mqtts protocol? [message #1773176] Fri, 22 September 2017 18:17 Go to next message
Chuck Williams is currently offline Chuck WilliamsFriend
Messages: 2
Registered: August 2017
Junior Member
I have the following connection string from one of my development portals:

mqtts://0514da43-afd0-482b-ba9e-ab61772d3fb3:LWdrwd_B52PG4JH0@mqtt.helium.com:28103

I'm trying to use the Sample class in the Java Paho client and I'm getting the following exception:

Exception in thread "main" java.lang.IllegalArgumentException: mqtts://0514da43-afd0-482b-ba9e-ab61772d3fb3:LWdrwd_B52PG4JH0@mqtt.helium.com:28103
at org.eclipse.paho.client.mqttv3.MqttConnectOptions.validateURI(MqttConnectOptions.java:529)
at org.eclipse.paho.client.mqttv3.MqttAsyncClient.<init>(MqttAsyncClient.java:378)
at org.eclipse.paho.client.mqttv3.MqttAsyncClient.<init>(MqttAsyncClient.java:270)
at org.eclipse.paho.client.mqttv3.MqttClient.<init>(MqttClient.java:228)
at com.rfidcollect.iot.Sample.<init>(Sample.java:250)
at com.rfidcollect.iot.Sample.main(Sample.java:177)

I've already modified the sample code to not use tcp: as the protocol. Here are the arguments to the execution of the Sample class:

-a subscribe -t 0514da43-afd0-482b-ba9e-ab61772d3fb3/atom/6081f9fffe000957/rx/# -b mqtts://0514da43-afd0-482b-ba9e-ab61772d3fb3:LWdrwd_B52PG4JH0@mqtt.helium.com -p 28103

Thank you in advance,
Chuck
Re: mqtts protocol? [message #1773239 is a reply to message #1773176] Mon, 25 September 2017 09:27 Go to previous messageGo to next message
James Sutton is currently offline James SuttonFriend
Messages: 71
Registered: July 2015
Member
Hi Chuck,

mqtt or mqtts isn't an official uri scheme (https://www.iana.org/assignments/uri-schemes/uri-schemes.xhtml) so that would be unlikely to work.

If you check the code where the exception was thrown, you'll see that only tcp, ws, wss, ssl and local are valid and accepted URI schemes. (https://github.com/eclipse/paho.mqtt.java/blob/master/org.eclipse.paho.client.mqttv3/src/main/java/org/eclipse/paho/client/mqttv3/MqttConnectOptions.java#L526)

I imagine that you've got mqtts instead of mqtt to indicate that it's a secure connection? If that's the case, you'll want to use the ssl uri scheme and use the SSL arguments (v / k / w / r)
Re: mqtts protocol? [message #1822722 is a reply to message #1773239] Thu, 12 March 2020 09:22 Go to previous message
Sameer Deswal is currently offline Sameer DeswalFriend
Messages: 1
Registered: March 2020
Junior Member
Hi @James Sutton
I'm not sure whether ws, wss supported URI schemes. Do you
Previous Topic:Java MQTT5 implementation
Next Topic:How correct method for test my mqtt client with Junit 5?
Goto Forum:
  


Current Time: Mon Oct 26 12:14:26 GMT 2020

Powered by FUDForum. Page generated in 0.09168 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top