2
votes

I'm kind of new to these protocols, and just started exploring Message brokers like Apache Apollo and RabbitMQ. So my broker receives MQTT messages from a publisher. And I would like to convert it into AMQP (preferably) or STOMP protocol to send to a web server. But I've so far been unable to do so. I looked into RabbitMQ, and tried enabling the MQTT plugin, but when I do load it, I'm unable to start the server. I was wondering if anyone can guide me here? Is there an API that can help me? And I'm very confused about RabbitMQ. I've been able to load other plugins easily,like stomp, management utilities etc.

2
Please have a look at my own answer and add on what you deem is right to it :)Srihari S

2 Answers

1
votes

I'm 100% sure it is doable. I am doing it right now with robomq.io broker. One cause could be sometimes bugs in your client library restrict you doing so.

Another thing you should be aware of is that internally, RabbitMQ MQTT adapter is mapped into amq.topic exchange by default, so on your STOMP peer, you should subscribe or send to /topic/yourTopic; on your AMQP peer, bind your queue to amq.topic exchange or publish to that exchange.

Follow this example code and documentation to build your client.

If you can't figure out your server, just get a free trial from robomq.io. It saves you time and money.

The development tool I am using is robomq.io broker, producers in Python (AMQP library: pika, MQTT library: paho, STOMP library: stompest), consumer in Node.js (library: amqplib).

Hope it helps!

0
votes

Well, I'm not sure if this question should be taken down. But if it has to be I leave it to the discretion of the moderators and the stackOverflow community in general. btw, I use Ubuntu 14.04.

About the RabbitMQ broker

So Mosquitto was running un the background occupying the port 1883 normally used for MQTT. I could have changed the port for RabbitMQ, but decided against it and tried to kill the Mosquitto process. But for some reason, I could NOT. For now, my quick fix was removing Mosquitto completely and this freed the port, enabling RabbitMQ to use it.

About the protocols

I've used Paho and the RabbitMQ libraries provided to code out simple programs that can publish and receive messages in AMQP/MQTT via the RabbitMQ broker. (My Googling needs to be better!) Still haven't converted one to the other. But that shouldn't be too big a step to achieve. Still would be nice to know if there's an API or something that can help me achieve the conversion in a very simple manner. Of course, if there's not, I'll figure it out ASAP

Any suggestions/comments are heartily welcome. I'm brand new to all this and could really use advice from all you seasoned pros :)