Changing mqtt uri prefix[WISE-PaaS/EnSaaS DB Service]
Currently, I am trying to write an android application that connects to an mqtt broker to subscribe and publish topics. In my research, I've found out that the library I am using (paho mqtt library: https://eclipse.github.io/paho.mqtt.c/MQTTClient/html/struct_m_q_t_t_client__connect_options.html) only accepts uris that start with 'tcp://' or 'ssl://'. The mqtt uri in the rabbitMQ secret starts with the prefix mqtt:// so I am unable to use it in the application at the moment.
Is there a way to get a uri that starts with 'tcp://'? I have tried just changing the prefix of the existing rabbitMQ uri from mqtt to tcp, but that ends up with the application crashing.
Thank you
- YYien Liu @Yien_Liu
Hi,
According to the documentation you provide, the format of URIs should be like this:protocol://host:port
And the host should be the "host" in the rabbitMQ secret, e.g rabbitmq.wise-paas.com
So the full URI should be tcp://rabbitmq.wise-paas.com:1883
- NIn reply tonicholastyy_wg18⬆:Nicholas Teo Yong Yeow @nicholastyy_wg18
Hi, I tried that but I get a new set of errors.
I'm not sure why this is happening, because when I tried it with a difference public broker (broker.hivemq.com) it worked perfectly fine.
^These are the 4 links that the error message leads to
- NNicholas Teo Yong Yeow @nicholastyy_wg18
Oh, and I tried with with both the normal host and external host. Thats why there's a 'pub' in the rabbitmq uri