--
--
Senior Inventor, Pervasive and Advanced Messaging Technologies
--
--
To learn more about MQTT please visit
To post to this group, send email to mq...@googlegroups.com
To unsubscribe from this group, send email to
mqtt+uns...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/mqtt
Unless stated otherwise above:
IBM United Kingdom Limited - Registered in England and Wales with number
741598.
Registered office: PO Box 41, North Harbour, Portsmouth, Hampshire PO6
3AU
On Thursday, 4 October 2012 at 11:55, Raphael Cohn wrote:
Dave,That's very interesting! Fancy collaborating on a Javascript client?Raph
Raphael Cohn
Chief Architect, StormMQSecretary, OASIS AMQP Standard
raphae...@StormMQ.com
UK Office:
Hamblethorpe Farm, Crag Lane, Bradley BD20 9DB, North Yorkshire, United Kingdom
Telephone: +44 845 3712 567
Registered office:
16 Anchor Street, Chelmsford, Essex, CM2 0JY, United Kingdom
StormMQ Limited is Registered in England and Wales under Company Number 07175657
StormMQ.com
On 4 October 2012 16:29, Dave Locke <lo...@uk.ibm.com> wrote:
its a little different but I have started a page on the Paho wiki about what it would mean provide MQTT over WebSockets in an inter-operable way. i.e. have first class MQTT support direct from a modern web browser where the app is written in HTML and JavaScript. The page can be found here: http://wiki.eclipse.org/Paho/Paho_Websockets
All the best
Dave LockeSenior Inventor, Pervasive and Advanced Messaging Technologies
<Untitled>
Feel free to collaborate with us on Eclipse Paho - we are looking at getting a javascript client added soon :-)
On Thursday, October 4, 2012 2:53:52 AM UTC-4, Raphael Cohn wrote:Interesting question... and one that comes quite often for messaging protocols.A messaging protocol needs delivery of messages in order. TCP gives that without any "effort" required on behalf of the protocol designer. UDP makes that harder and requires protocol-level support.
I'm not following why would be needed. Considering that the size of an MQQT packet tends to be very small, there is little need for packets to arrive in order as out of order packets can be ignored. As such, it sees to me that the MQQT protocol could be used directly over serial connections or embedded in udp.At least, that's how I'm working on it with MQQT on a launchpad. For my test project, the launchpad will act as an mqqt server - waiting for a connection on it's serial port.
The client runs on my pc, it connects to the launchpad via a wireless virtual com port and then submits a subscribe fridge-tempIt then waits some pre-determined time and if it does not receive a suback or a message, it will retry the subscription.Once it has confirmed subscription, it consumes any published temperatures and logs them for future analysis.For topic fridge-temp it's 10 chars from the original ascii set, so 10 bytes of data. The temperature can be sent in a wasteful human readable format of+999.999F to -999.999F, 9 chars so 9 bytes. Add in the packet framing of 2 bytes and it comes to 21 bytes, so far below the maximum packet length of udp in use today that fragmentation would never be a reasonable concern.As long as I'm using QOS 0, UDP is a fine protocol for publishing a stream of information, such as temperature readings taken every 10 seconds. If a bunch of udp packets get dropped at some point, there is no problem as it is not important for the data to be reliably collected every minute. Instead, reliability can be put in place using a combination of:MQQT client using ping requests to periodically ensure the connection is still alive. If it does not receive 3 out of 5 acknowledgements on pings then it can send an alert to inform someone of a problem.
Additional logic can periodically check to ensure that there have been at least 20 readings received in the last our. 1/3rd of the readings is an acceptable number for this use case.All of that is application logic. MQQT doesn't need to concern itself with, or even care, about that data. As I read the protocol, as long as QOS is 0, there is no requirement for responses for most packets.
I am not sure if requiring binary format is a good idea. Not all browsers can use it, plus it can be a real headache for someone used to coding where ints and chars are almost interchangeable to start thinking at the byte level.
Also a lot of websocket server implementations have their own custom formatting, for example http://jwebsocket.org/ is a java websocket server and javascript client. While it can be used to build a simple websocket server, it uses plugins to allow one server to route traffic to many different brokers. This is partially done using special data encoding where the data is sent inside a json encoded packet with additional framing data to direct it to the correct plugin.
As it is both simple and standard practice to base64 encode binary data, the mqqt packets could be base64 encoded and embedded in json. It would not be until everything is stripped off and delivered to the mqqt server or client that it is back in binary format..as long as those 2 pieces get the data properly formatted - they should not need to care about what might have happened to the data while it was being transported between the..base64 encoded in json, or written out on punch cards and sent via carrier pigeon - the transport mechanism is irrelevant.
As such, I'd extend the protocol name to be more clear, ie:Must use "mqtt" as a suffix for the websocket protocol name.Should include the supported mqtt version after the suffixMust include a descriptive label in the protocol name.For example:mqtt-v3.1-raw-binaryMQTT protocol version 3.1, raw binary payloadmqtt-v3.1-json-base64
MQTT protocol version 3.1, json encoded packets of some sort, base64 encoded payloads
On Thursday, October 4, 2012 11:30:20 AM UTC-4, Dave Locke wrote:its a little different but I have started a page on the Paho wiki about what it would mean provide MQTT over WebSockets in an inter-operable way. i.e. have first class MQTT support direct from a modern web browser where the app is written in HTML and JavaScript. The page can be found here: http://wiki.eclipse.org/Paho/Paho_Websockets
If you...
- Only want at most once messaging (QoS 0);
- Have tiny messages;
- Don't care about data loss;
- Don't care about order of data (ie don't care about it being a queue)
- Don't want or can handle less security needs (and UDP + TLS solutions aren't much fun to get working)
then one can use UDP. But then that sort of use case is fairly specialised, and at that point, I wouldn't even use MQTT. I'd simply send UDP packets of known structure. And may be use some of zeromq to help me out.
--