HTTP API for MQTT Broker (Mosquitto)

3,587 views
Skip to first unread message

Satish Madala

unread,
Nov 13, 2014, 12:25:00 AM11/13/14
to mq...@googlegroups.com
Hi,

I have a MQTT Broker (Server) to which 20,000 publishing clients will be sending "Json Data". And among those pub-clients, Few clients can directly send through MQTT  protocol but few clients can send only through HTTP POST.

How to build a Bridge for both protocols. Moreover, I wish to unencrypt the data posted by client & validate data-type for few required fields and Save to MongoDB (or Send to subscriber client to save it to DB?)

Andy Piper

unread,
Nov 13, 2014, 12:20:01 PM11/13/14
to mq...@googlegroups.com
You could always just use node-red to do the bridging.

--
To learn more about MQTT please visit http://mqtt.org
---
You received this message because you are subscribed to the Google Groups "MQTT" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mqtt+uns...@googlegroups.com.
To post to this group, send email to mq...@googlegroups.com.
Visit this group at http://groups.google.com/group/mqtt.
For more options, visit https://groups.google.com/d/optout.



--
Andy Piper | Kingston upon Thames, London (UK)
blog: http://andypiper.co.uk   |   skype: andypiperuk
twitter: @andypiper  |  images: http://www.flickr.com/photos/andypiper

Satish Madala

unread,
Nov 13, 2014, 8:44:15 PM11/13/14
to mq...@googlegroups.com
Hi Andy,

I find Nodejs and Punte a bit unmanageable (I have few custom modifications). Are there any Python alternatives? 

Can I use Punte in production ? How do i make MQTT Publishers authenticate to particular topic for data posting & validate data on punte before saving it to MongoDB?

I want to make this on broker end! The downside of subscribing-client doing this is, if data-load increases on wldcard, subscribing-client  may miss the data while it also have to save it to DB!! Do the same problem persists with broker too? 

Dominik Obermaier

unread,
Nov 14, 2014, 6:20:19 AM11/14/14
to mq...@googlegroups.com
Hi Satish,

we have seen many projects where people are using the HiveMQ plugin system for persisting messages to the DB (see [1], [2]). In recent projects some customers of us were using the HiveMQ RESTService [3], [4]. This allows to use standard JAX-RS 2.0 resource implementations to be used together with MQTT. So writing a MQTT-HTTP bridge (with custom logic for your use case) is a few-liner.

You'd need to do that with Java, though. If this is a showstopper for you, some out-of-the-box bridges like Ponte may work. I'd be also interested to know if there are any python alternatives available :)

Best,
Dominik


[1] http://www.hivemq.com/mqtt-sql-database/
[2] https://github.com/hivemq/hivemq-database-example-plugin
[3] https://github.com/hivemq/hivemq-spi/blob/master/src/main/java/com/dcsquare/hivemq/spi/services/RESTService.java
[4] https://github.com/hivemq/hivemq-spi/blob/master/src/main/java/com/dcsquare/hivemq/spi/services/rest/RESTConfig.java

Andrea Selva

unread,
Nov 14, 2014, 7:12:56 AM11/14/14
to mq...@googlegroups.com

Hi
if you need just to bridge two protocols,probably an integration solution like Camel could also be a viable solution.

Andrea

Shashank Agarwal

unread,
Nov 29, 2014, 7:07:43 AM11/29/14
to mq...@googlegroups.com
Hi Satish, 

As Andy suggested, Node-red (nodered.org) is worth looking at. It's a graphical mesh-up tool and you could do pretty much anything with input and send outputs to multitude of systems.

Regards
Shashank
Reply all
Reply to author
Forward
0 new messages