message element

Type: edcMessage
Namespace: http://eurotech.com/edc/2.0
XML Schema: edc.xsd

EdcMessage provides an abstraction over the messages sent in and out of the Everyware Cloud platform. It encapsulates all the information regarding the message: the topic it was addressed to, the timestamp when it was received by the platform, and the payload contained in the message. The payload can be represented by a raw binary array or by an EdcPayload object if it was formatted as such when the message was composed and sent. Refer to the EdcPayload documentation for more details on how EdcPayload are modelled and how they can be constructed.
The EdcMessage class is used both by the messages/search API to return message results from the platform, as well as by messages/store and messages/publish API to send messages to the platform.

Example XML

<?xml version="1.0" encoding="UTF-8"?> <message xmlns="http://eurotech.com/edc/2.0"> <topic>...</topic> <receivedOn>...</receivedOn> <payload> <sentOn>...</sentOn> <position> <longitude>...</longitude> <latitude>...</latitude> <altitude>...</altitude> <precision>...</precision> <heading>...</heading> <speed>...</speed> <timestamp>...</timestamp> <satellites>...</satellites> <status>...</status> </position> <metrics> <metric> <name>...</name> <type>...</type> <value>...</value> </metric> <metric> <!--...--> </metric> <!--...more "metric" elements...--> </metrics> <body>...</body> </payload> <uuid>...</uuid> </message>

Example JSON

{ "topic" : "...", "receivedOn" : "...", "payload" : { "sentOn" : "...", "position" : { "longitude" : ..., "latitude" : ..., "altitude" : ..., "precision" : ..., "heading" : ..., "speed" : ..., "timestamp" : "...", "satellites" : ..., "status" : ... }, "metrics" : { "metric" : [ { "name" : "...", "type" : "...", "value" : "..." }, ... ] }, "body" : "..." }, "uuid" : "..." }