Slide 30
Slide 30 text
©2023 Public. All Rights Reserved.
Keep the structure as simple as possible
The requester creates a unique request ID in order to
match the response message in return.
The requester tells the target topic to which the
response should be published to.
Payload is expressed in JSON format and should have a
JSON schema for validation
The responder must include the request ID in the
response and transmit the response to the given
response topic.
The response payload contains a timestamp, the a
success indicator and a response message.
Optionally meta data can be added to the response.
Command message payloads
Example payload for a command message with the topic
cmd/residence/vacation02/room/bath03/light/ceiling01/req/dim
{
"req-
id": "758b1b2c-4c5b-4a6a-8dfc-
b4af7425e6fa",
"luminosity": 0.5,
"res-
to": "cmd/mobile/iphone05/app/residence/..."
}
Example payload for a status response message with the topic
cmd/mobile/iphone05/app/residence-
commander/res/light/dim
{
"req-
id": "758b1b2c-4c5b-4a6a-8dfc-
b4af7425e6fa",
"timestamp": 1693406941326,
"success": false,
"message": "Light was already dimmed to 50% luminosity",
"meta": {
"error": "Too much power consumption, dimming down."
}
}