Changing mqtt uri prefix
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.
- 3 replies
- YYien Liu @Yien_Liu2021-08-02 02:18:30.542Z
According to the documentation you provide, the format of URIs should be like this:
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_wg182021-08-02 04:18:26.240Z
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