failure to process large messages using IBM's Javascript client

130 views
Skip to first unread message

Sam Matthews

unread,
Mar 18, 2014, 6:22:28 PM3/18/14
to mq...@googlegroups.com
Hello all… 

I am trying to no avail to pass the data url (below) as a payload.

I am using the PAHO javascript client (mqttws31.js). 


I have been going over the library for hours.  I see many references to the ‘remaining length’ field, but I cannot figure out if any action is required on my part to process large messages. 

I am thus far working with a single client that publishes and subscribes on a single topic.
 
The behavior I see is at the the messages is published, and is received on “onMessageDelivered” event, but not “onMessagedArrived” event.

I have no issue with smaller strings but beyond a certain length I stop receiving the message on “onMessageArrived”.

I am using message.payloadString to store the message.

Thanks for any help.

Sam


data:image/jpeg;base64,/9j/4AAQSkZJRgABAQAAAQABAAD/2wBDAAMCAgICAgMCAgIDAwMDBAYEBAQEBAgGBgUGCQgKCgkICQkKDA8MCgsOCwkJDRENDg8QEBEQCgwSExIQEw8QEBD/2wBDAQMDAwQDBAgEBAgQCwkLEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBD/wAARCABLAGQDAREAAhEBAxEB/8QAHwAAAQUBAQEBAQEAAAAAAAAAAAECAwQFBgcICQoL/8QAtRAAAgEDAwIEAwUFBAQAAAF9AQIDAAQRBRIhMUEGE1FhByJxFDKBkaEII0KxwRVS0fAkM2JyggkKFhcYGRolJicoKSo0NTY3ODk6Q0RFRkdISUpTVFVWV1hZWmNkZWZnaGlqc3R1dnd4eXqDhIWGh4iJipKTlJWWl5iZmqKjpKWmp6ipqrKztLW2t7i5usLDxMXGx8jJytLT1NXW19jZ2uHi4+Tl5ufo6erx8vP09fb3+Pn6/8QAHwEAAwEBAQEBAQEBAQAAAAAAAAECAwQFBgcICQoL/8QAtREAAgECBAQDBAcFBAQAAQJ3AAECAxEEBSExBhJBUQdhcRMiMoEIFEKRobHBCSMzUvAVYnLRChYkNOEl8RcYGRomJygpKjU2Nzg5OkNERUZHSElKU1RVVldYWVpjZGVmZ2hpanN0dXZ3eH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5GPT0qZK6TBPU6TRfHPiXRZY7yz1kAuGiliA2sUVR8zcANnnHJbKnPUE7TrVKluZq/frb9fLrcqi1QvZadun/AGt4wCxSXEUEzajMWLTyOG2sQRuHHJwe/07Cu6nj6dGjyQh7zvrfr3/AOAzkq4edepzTlp2Nj/hoP4+mHyD8bvH3lAbRH/wkt7tx6Y8zGPavMdSp9pm6pU07qKODLEYz361LutWixSxGB15/KnJvRdRJXJA+Dxg9sVtGauuoncla7C4BlCcdMZqpVoQdm/z/QXLJnUfFHxBrXib4g+Jdb1/Up76+uNTnEk8zZYqp2qo9FVQFVRgKAAAAMVz0VaNl5fkXvq/63ORPDE96vqHQYvJwelTDX+vUB0XKj3FVDVahISUDy3PsKmovcYo7kcfK0Q1VhyHsSqnaSMjB9+aeyuFhg6Z7ioeiTGNJIZee9JaNDHv/SnJ2TQkhCcEEdeKHryy6ghzMcsM9M05tq/9dGJIIUVlJYAnJrOlTjNNyQTbT0P/2Q==

Andy Piper

unread,
Mar 18, 2014, 7:34:21 PM3/18/14
to mq...@googlegroups.com
Hey Sam

The MQTT Google Group is for general discussion of the protocol. You'd be better off asking this question on the paho-dev mailing list and / or in Eclipse Bugzilla, where the developers for that client hang out.

If you're able to be more specific about the size of data you're sending where things start to fail, that would probably be useful too.

Andy


--
To learn more about MQTT please visit http://mqtt.org
---
You received this message because you are subscribed to the Google Groups "MQ Telemetry Transport" 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

Sam Matthews

unread,
Mar 19, 2014, 8:10:45 AM3/19/14
to mq...@googlegroups.com
Thanks, I will do that.  I will also try to be more specific regarding the size of the post.

Sam Matthews

unread,
Mar 19, 2014, 2:02:18 PM3/19/14
to mq...@googlegroups.com
Hi, I wanted to get back to you on the size of the payload that is failing.. approximately 3600 chars.

I have hosted a sample of a chat program I am working on.


Currently it subscribes and publishes on the same Topic (so effectively you are chatting with yourself).

Ive been looking at Wireshark logs and incrementing the payload.  Typically I will get 2 hits back from the server for each one I send.  One is my payload and the other is .. I don't know.  In the case where my payload is > 3600 I get no payload at all.. and just the other packet.  I apologize for not understanding the protocol well enough, but I really wasn't intending on learning it intimately. 

My QOS = 1 and I have tried pointing to all the following public brokers....


.. as well as my own broker running Mosca on OpenShift.

Thanks again,
Sam 

Nicholas O'Leary

unread,
Mar 19, 2014, 8:19:46 PM3/19/14
to mq...@googlegroups.com

Sam,

When did you grab the client code? We recently merged the develop branch to master that brings support for mqtt packets being split over multiple WS frames.

It is possible that once your message gets to a certain size it us being fragmented by the server... which wouldn't have worked with the master branch of the client until a couple weeks ago.

Nick

Sam Matthews

unread,
Mar 19, 2014, 8:22:03 PM3/19/14
to mq...@googlegroups.com
Hi Nick,

I have had it for a month or so …I will visit the git site and get the latest.  Thanks.

Sam

You received this message because you are subscribed to a topic in the Google Groups "MQ Telemetry Transport" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/mqtt/ReGqXfQEoOE/unsubscribe.
To unsubscribe from this group and all its topics, send an email to mqtt+uns...@googlegroups.com.

Matteo Collina

unread,
Mar 20, 2014, 3:56:39 AM3/20/14
to mq...@googlegroups.com


Il giovedì 20 marzo 2014, Nicholas O'Leary <nick....@gmail.com> ha scritto:

When did you grab the client code? We recently merged the develop branch to master that brings support for mqtt packets being split over multiple WS frames.

GOOD news! IMHO it was the biggest problem of that library.

It is possible that once your message gets to a certain size it us being fragmented by the server... which wouldn't have worked with the master branch of the client until a couple weeks ago.


This is exactly what Mosca does. 

BTW, Mosca also have an embedded version of a MQTT over websocket client. That should work well with bigger payloads.

Matteo

Sam Matthews

unread,
Mar 20, 2014, 8:03:57 AM3/20/14
to mq...@googlegroups.com
Hi Matteo,

I would be happy to use Mosca in standalone fashion, but AFAIK I can’t deploy it to any PaaS that I know of.  This is why I opted for Mosca embedded in the node app.  When you say “this is exactly what Mosca does”.. does that mean that it also fragments the messages and therefore will not work with a large payload?  

I have successfully tested large payloads with the latest version of the Paho javascript client and “test.mosca.io” as the broker.  I still can’t get my embedded version of Mosca to process the large payloads however. 

I have just installed Docker, and your Mosca docker image.  I was able to get it running and connect my app to it… very nice stuff!!

Questions.. 
Can I expect Mosca embedded in a node app to behave the same as the standalone Mosca.  If not ….
Do you know of a way I can host Mosca standalone… much in the same way you have hosted “test.mosca.io”? 

Thanks again,
Sam 



Matteo

--
To learn more about MQTT please visit http://mqtt.org
---
You received this message because you are subscribed to a topic in the Google Groups "MQ Telemetry Transport" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/mqtt/ReGqXfQEoOE/unsubscribe.
To unsubscribe from this group and all its topics, send an email to mqtt+uns...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages