You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This proposal builds on @hspaay's message envelope proposal in #34 (and #32), and @RobWin's suggestion for acknowledgements of certain messages (e.g. #29).
It is a further exploration of the idea of splitting operation and messageType into separate members of a message, where operation is an op name taken directly from the Thing Description specification and messageType is one of three basic types: request, response and notification.
I've kept response and notification separate as per @hspaay's original proposal because I do think the two are meaningfully different, though I still feel a bit uneasy about this because "notification" is not a clearly defined concept in existing WoT specifications. It also kind of mixes up the common request/response and publish/subscribe design patterns.
Although I have adopted the proposal of a consistent "name" member to contain the name of the affordance the message relates to, one way this proposal differs from @hspaay's proposal is that it keeps separate members for different data payloads depending on the type of operation, rather try to combine everything into input and output. This is intended to make the mapping of data schemas from a Thing Description more obvious and not have members with the same name but different meanings:
Property-related messages have a "value" (conforming to the data schema of PropertyAffordances)
Action related messages have an "input" and an "output" (conforming to the input and output data schemas in ActionAffordances) and a "status" (consistent with the HTTP Basic Profile)
Event related messages have event "data" (conforming to the data member in EventAffordances)
Another way that this proposal differs is that there are never multiple responses to a request, only multiple notifications and a single response. This is achieved by property observations and event subscriptions having a request, response then notifications, and action invocations having a request, notifications then a single response.
Note: To address the issue raised in #38 about non-confirmable writes, a value could only be provided in a response if it is confirmed to have been written.
I don't have a complete set of examples yet and there are still some questions that I think would need answering, but I wanted to see what people thought.
Notes:
In this proposal there would be no separate error message type, since the error would be contained in a response.
The ping and pong messages from the strawman proposal also don't fit neatly into this approach, though I'm not completely sure they're needed.
I'm not sure about how correlationIDs should work in queryaction and queryallactions messages, but I will file a separate issue for that.
I was too lazy to generate unique UUIDs for every message and match up correlationIDs, but hopefully you get the idea.
The text was updated successfully, but these errors were encountered:
benfrancis
changed the title
Split operation and messageType into separate members of a message
Proposal: Split operation and messageType into separate members of a message
Feb 12, 2025
This proposal builds on @hspaay's message envelope proposal in #34 (and #32), and @RobWin's suggestion for acknowledgements of certain messages (e.g. #29).
It is a further exploration of the idea of splitting
operation
andmessageType
into separate members of a message, whereoperation
is anop
name taken directly from the Thing Description specification andmessageType
is one of three basic types: request, response and notification.I've kept response and notification separate as per @hspaay's original proposal because I do think the two are meaningfully different, though I still feel a bit uneasy about this because "notification" is not a clearly defined concept in existing WoT specifications. It also kind of mixes up the common request/response and publish/subscribe design patterns.
Although I have adopted the proposal of a consistent "name" member to contain the name of the affordance the message relates to, one way this proposal differs from @hspaay's proposal is that it keeps separate members for different data payloads depending on the type of operation, rather try to combine everything into
input
andoutput
. This is intended to make the mapping of data schemas from a Thing Description more obvious and not have members with the same name but different meanings:input
andoutput
data schemas in ActionAffordances) and a "status" (consistent with the HTTP Basic Profile)data
member in EventAffordances)Another way that this proposal differs is that there are never multiple responses to a request, only multiple notifications and a single response. This is achieved by property observations and event subscriptions having a request, response then notifications, and action invocations having a request, notifications then a single response.
Message Types
Operations
readproperty
writeproperty
observeproperty
unobserveproperty
readallproperties
writeallproperties
readmultipleproperties
writemultipleproperties
observeallproperties
unobserveallproperties
invokeaction
queryaction
queryallactions
subscribeevent
unsubscribeevent
subscribeallevents
unsubscribeallevents
* I'm a bit uneasy about the lifecycle of the invokeaction operation because we have kind of invented a combined invokeaction/observeaction operation, which doesn't exist in the Thing Description specification. There is currently no way to specify the data schema of an action status and no way to observe the status of a property in the the TD spec.
Examples
readproperty
Request
Success Response
Error Response
writeproperty
Request
Response
Note: To address the issue raised in #38 about non-confirmable writes, a value could only be provided in a response if it is confirmed to have been written.
observeproperty
Request
Response
Notification
unobserveproperty
Request
Response
readallproperties
Request
Response
readmultipleproperties
Request
Response
invokeaction
Request
Notification
Response
queryaction
Request
Response
queryallactions
Request
Response
subscribeevent
Request
Response
Notification
I don't have a complete set of examples yet and there are still some questions that I think would need answering, but I wanted to see what people thought.
Notes:
error
message type, since the error would be contained in a response.ping
andpong
messages from the strawman proposal also don't fit neatly into this approach, though I'm not completely sure they're needed.correlationID
s should work inqueryaction
andqueryallactions
messages, but I will file a separate issue for that.The text was updated successfully, but these errors were encountered: