I would like to get some help regarding subscribing to a queue on a RabbitMQ server.
A client has set up the RabbitMQ broker with the MQTT plugin. Our ESP device can connect to the RabbitMQ broker but is unable to subscribe to the queue.
We have tried using the PubSubClient's ESP example but it does not seem fruitful.
We have went through a lot of posts but none of which help out on how to subscribe to the broker's queue. Can someone give any code example for subscribing to RabbitMQ?
Try searching the forum for the broker you want to use. I don't recall ever seeing it in use here though and I rather suspect that the principal post you'll find will be your own - which is why I haven't mentioned yours by name.
All the message stuff I've seen here has been MQTT, presumably because of the price.
I actually had went through the broker's forum and was unable to find any suitable information but I actually did find the solution to my problem.
So the RabbitMQ creates a queue for the device that is connected to the broker. The exchange named "amq.topic" is auto bound to the newly made queue. So any data that is published from the amq.topic exchange is sent to our connected device as long as the routing key in the message is same as the topic that we have subscribed to in our code.
For example if I use:
mqttClient.subscribe("inTopic");
then, I would need to keep the routing key "inTopic" as well.