Skip to end of metadata
Go to start of metadata

Thing uses GadgetKeeper message broker to exchange messages. 

Communication Protocols: MQTT, XMPP, STOMP
RPC Protocol: JSON-RPC 2.0
How it works:
  1. Thing subscribes to a predefined topic on GadgetKeeper message broker using preferred protocol
  2. GadgetKeeper sends a command to the topic
  3. Thing receives command from the topic
  4. Thing sends response to the topic
Constraints:
  1. GadgetKeeper servers must be reachable from Thing
  2. Thing must keep alive connection to GadgetKeeper message broker

 

Connection Settings


Field Required Description Dialog
Name x connection name
Protocol x select "json-rpc over messaging"
Response, ms x

number of milliseconds GadgetKeeper will wait for Thing

to receive message and send response

Date format x

date format representation:

  • iso-8601 - date is represented as string (example: "2013-05-27UTC06:07:16Z")
  • unix-timestamp - not supported, date is represented as number (example: 1369634836)
Description   connection description

 

MQTT Connection 


MQTT Server api.gadgetkeeper.com
MQTT Port 1883
MQTTS Port 1884
Request Topic thing.<THING_ID>
Response Topic thing.<THING_ID>

 

Example Scenario Using MQTT


Given

  1. Thing has remote method "echo"
  2. Thing want to be able to handle this method


Workflow

  1. Thing establishes MQTT connection to GadgetKeeper MQTT server
  2. Thing subscribes to topic "thing.990fc000c90211e2b5566c626dd90e00", there "990fc000c90211e2b5566c626dd90e00" is its ID
  3. GadgetKeeper sends JSON-RPC request message to the topic: 

  4. Thing receives JSON request message and send a response back to the topic:

  5. GadgetKeeper receives the response

 



 

  • No labels