Closed thompcd closed 1 year ago
contentType: A mime-type description of the object being sent. The requestor includes this content to allow easier processing of the message. Our default cmd messages have been type "registerWriteMsg" We will be updating to registerWriteMsgV1 and adding support for coildWriteMsgV1. Based on this incoming value, the difference will simply be the type of the "value" key's value
sessionId: Identifies a unique session. The requestor generates the session-id for the command and includes it in the request payload. The response topic uses the session-id upon command completion. By using a session-id, the middleware can store and track the status of commands and determine if a request is still in transit, successful, or in error. Devices can also keep track of in-transit requests when communicating with multiple devices. Semi-unique sessionId generation is acceptable (appending timestamp, etc)
responseTopic: In a command, there is a request for an action to happen and then a response that indicates the status of the command (successful or error). To avoid hard-coding response topics, the command request payload includes a field that has a response topic. The device publishes its response payload using the response topic. For example, consider the following command topic:
cmd/security/device-1/cert-rotation In the payload of this request, the application includes a field that denotes where the device (device-1) should send its response and a session identifier for tracking. See the following example for this command’s payload structure:
{ .... "contentType":"coilWriteMsgV1", "sessionId":"session-820923084792", "resTopic":"cmd/security/app1/res" .... }
"contentType" property may need to come in to support boolean coils #13 before this feature