Skip to main content



      Home
Home » Eclipse Projects » Paho » Data structure of the messages in MQTT javascript Client PAHO
Data structure of the messages in MQTT javascript Client PAHO [message #1695770] Tue, 19 May 2015 04:11 Go to next message
Eclipse UserFriend
Hello All,

I am using the Eclipse Paho javascript client to communicate between my device and the broker.
So currently I am sending a string in the message.

message1 = new Paho.MQTT.Message("Hello");

Is there a way I can send the message in any other format like a json or Google protocol Buffer instead of string?

Thankyou

Re: Data structure of the messages in MQTT javascript Client PAHO [message #1695782 is a reply to message #1695770] Tue, 19 May 2015 05:08 Go to previous messageGo to next message
Eclipse UserFriend
As long as you can provide a String or ArrayBuffer to the Message constructor, you will be fine.
In order to post a JSON document, that would e.g. be:

message1 = new Paho.MQTT.Message(JSON.stringify( { "first_name": "ankur", "last_name": "bhatia" } ));
Re: Data structure of the messages in MQTT javascript Client PAHO [message #1696142 is a reply to message #1695782] Fri, 22 May 2015 07:02 Go to previous message
Eclipse UserFriend
Thanks a lot Benjamin.
Previous Topic:Not getting Published message from Mqtt Broker in Paho Client
Next Topic:Paho c++ build problem
Goto Forum:
  


Current Time: Thu Jul 17 19:26:17 EDT 2025

Powered by FUDForum. Page generated in 0.03096 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top