Protocol of choice (AMQP, MQTT, STOMP, ...)
-
For a robust and stateless network of sensors and actors, what is your preferred platform agnostic protocol of choice - and why?
This is just for discussion. I'm not looking for something specific myself but would like to hear your opinions.
-
XMPP too can be used for this, but it's verbose, and in fact I pretty much hate XML with a passion. Anyway, to answer the question I like MQTT because of how light weight it is, but it is a binary protocol so "light weights" need not apply
Though AMQP and STOMP are easier to deal with, if you can do XMPP or HTTP, you can do those with little effort.
-
@tonyshowoff said in Protocol of choice (AMQP, MQTT, STOMP, ...):
XMPP too can be used for this, but it's verbose, and in fact I pretty much hate XML with a passion. Anyway, to answer the question I like MQTT because of how light weight it is, but it is a binary protocol so "light weights" need not apply
Though AMQP and STOMP are easier to deal with, if you can do XMPP or HTTP, you can do those with little effort.
You are not alone Wouldn't say "hate", but still PITA. But there's no real alternative when it comes to exchanging complex and strongly typed data. JSON is OK most of the time.
I'm using AMQP - which is awesome IMHO - with JSON/XML payload and / or a custom command interface most of the time. Simple example: To get a temperature reading from a DS18B20 attached to a Pi it would look like "get|temperature|sensorid|degreecelsius" (just an example for pulling data, normally they are posting readings without getting asked first).
Are you still able to use subscriptions and exchanges with MQTT? Haven't tried MQTT yet, but I like the concept and it seems to be much more lightweight compared to AMQP.
-
@thwr said in Protocol of choice (AMQP, MQTT, STOMP, ...):
You are not alone Wouldn't say "hate", but still PITA. But there's no real alternative when it comes to exchanging complex and strongly typed data. JSON is OK most of the time.
I use this a lot over the last couple of years, depending on the situation, especially if I'm making something from scratch myself. It doesn't suffer from JSON's typing issues.
Even simpler it's trivial to make a type-length-value encoding scheme if one were so inclined. The problem is XML is far, far too verbose and often contains more information than necessary, and it's great at wasting bandwidth and disk space as well.
Interesting anecdote: a lecture involving satellite communication, the speaker mentioned that in government projects they use XML a lot because they don't care about wasting the money and/or encoding/decoding time, meanwhile on private projects they use extremely small binary protocols.
Are you still able to use subscriptions and exchanges with MQTT? Haven't tried MQTT yet, but I like the concept and it seems to be much more lightweight compared to AMQP.
Subscriptions yes, exchanges sort of, they're typically called topics but to lessen confusion things like RabbitMQ call them "topic exchanges."
-
@tonyshowoff Msgpack looks interesting. I've got an upcoming project where I need some very small footprint (low power 8 bit uC), some of the grid nodes probably even need to send data via SMS for example (160 bytes per message). Msgpack with MQTT... Need to do some reading