Skip to end of metadata
Go to start of metadata

GadgetKeeper and Thing use external MQTT broker to exchange messages. 

Communication Protocols: MQTT
RPC Protocol: JSON-RPC 2.0
How it works:
  1. Thing subscribes to a request topic on MQTT message broker
  2. GadgetKeeper subscribes to the response topic on MQTT message broker
  3. GadgetKeeper sends a command to the request topic
  4. Thing receives command from the request topic
  5. Thing sends a response to the response topic
  6. GadgetKeeper receives the response
  7. GadgetKeeper disconnects from MQTT message broker
Constraints:
  1. MQTT message broker must be reachable from both Thing and GadgetKeeper
  2. Thing must keep alive connection to MQTT message broker

 

Connection Settings


Field Required Description Dialog
Name x connection name
Protocol x select "json-rpc over mqtt"
Host x MQTT broker host
Port x MQTT broker port
Secure   use MQTTS
Request topic x topic to send a command
Response topic x topic to receive a response
Connection, ms x

number of milliseconds GadgetKeeper can spent on connection to MQTT broker

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

 

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 the specified MQTT Broker server
  2. Thing subscribes to the specified request topic
  3. GadgetKeeper subscribes to the specified response topic
  4. GadgetKeeper sends a JSON-RPC request message to the request topic: 

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

  6. GadgetKeeper receives the response and disconnects from MQTT broker

 



 

  • No labels