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


FieldRequiredDescriptionDialog
Namexconnection name
Protocolxselect "json-rpc over mqtt"
HostxMQTT broker host
PortxMQTT broker port
Secure use MQTTS
Request topicxtopic to send a command
Response topicxtopic to receive a response
Connection, msx

number of milliseconds GadgetKeeper can spent on connection to MQTT broker

Response, msx

number of milliseconds GadgetKeeper will wait for Thing

to receive message and send response

Date formatx

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