-
Notifications
You must be signed in to change notification settings - Fork 589
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
MQTT 3.1.1 and 5.0 transport binding #158
Conversation
mqtt-transport-binding.md
Outdated
For instance, if the declared `contentType` is | ||
`application/json;charset=utf-8`, the expectation is that the `data` attribute | ||
value is made available as [UTF-8][RFC3629] encoded JSON text for use in | ||
AMQP. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Change AMQP to MQTT
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
mqtt-transport-binding.md
Outdated
## 3. MQTT PUBLISH Message Mapping | ||
|
||
With MQTT 5.0, the content mode is chosen by the sender of the event. Gestures | ||
that might allow solicitation of events using a particular mode might be |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"Gestures .... " is unclear - reword sentence.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"Protocol usage patterns"
mqtt-transport-binding.md
Outdated
that might allow solicitation of events using a particular mode might be | ||
defined by an application, but are not defined here. | ||
|
||
The receiver of the event can distinguish between the two modes by inspecting |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
change to "two content modes"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
mqtt-transport-binding.md
Outdated
defined by an application, but are not defined here. | ||
|
||
The receiver of the event can distinguish between the two modes by inspecting | ||
the `content-type` message field. If the value is prefixed with the Cloud |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Replace "value" with "value of the Content Type property"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
mqtt-transport-binding.md
Outdated
[event format](#14-event-formats), the receiver uses *structured* mode, | ||
otherwise it defaults to *binary* mode. | ||
|
||
If a receiver detects the Cloud Events media type, but with an event format that |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you clarify how the receiver "detects the Cloud Event media type".
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"If a receiver finds a CloudEvents media type as per the above rule"
mqtt-transport-binding.md
Outdated
The *binary* content mode accommodates any shape of event data, and allows for | ||
efficient transfer and without transcoding effort. | ||
|
||
#### 3.1.1 MQTT PUBLISH content-type |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
MQTT PUBLISH Content Type (normative name)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
mqtt-transport-binding.md
Outdated
defined by an application, but are not defined here. | ||
|
||
The receiver of the event can distinguish between the two modes by inspecting | ||
the `content-type` message field. If the value is prefixed with the Cloud |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Replace " the 'content-type' message field" with "the Content Type property of the MQTT PUBLISH message"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
mqtt-transport-binding.md
Outdated
|
||
#### 3.1.1 MQTT PUBLISH content-type | ||
|
||
For the *binary* mode, the MQTT PUBLISH message's [`content-type`][5-content-type] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Replace "content-type field value" with "MQTT Content Type property"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"the MQTT PUBLISH message's [Content Type
][5-content-type] property"
mqtt-transport-binding.md
Outdated
hops, and across multiple transports. This is the only supported mode for | ||
MQTT 3.1.1 | ||
|
||
#### 3.2.1. MQTT Content-Type |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"Content Type" not "Content-Type"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
mqtt-transport-binding.md
Outdated
|
||
#### 3.2.1. MQTT Content-Type | ||
|
||
For MQTT 5.0, the [MQTT `content-type`][5-content-type] field is set to the media |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Content Type property
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
mqtt-transport-binding.md
Outdated
#### 3.1.3. Metadata Headers | ||
|
||
All [Cloud Events][CE] attributes with exception of `contentType` and `data` | ||
are individually mapped to and from the MQTT PUBLISH User Property section. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
change to: ... from one or more User Property fields in the MQTT PUBLISH message.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am making this slightly stronger: "MUST be individually mapped to and from the User Property fields in the MQTT PUBLISH message."
mqtt-transport-binding.md
Outdated
|
||
##### 3.1.3.1 User Property Names | ||
|
||
Cloud Event attribute names are used unchanged in the MQTT PUBLISH User Property |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
change to "in each User Property in the MQTT PUBLISH message.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Again, stronger: "Cloud Event attribute names MUST be used unchanged in each mapped User Property
in the MQTT PUBLISH message."
mqtt-transport-binding.md
Outdated
|
||
##### 3.1.3.2 User Property Values | ||
|
||
The value for each MQTT PUBLISH user property is constructed from the respective |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
User Property
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
mqtt-transport-binding.md
Outdated
``` text | ||
------------------ PUBLISH ------------------- | ||
|
||
topic: mytopic |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
topic: -> Topic Name:
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
mqtt-transport-binding.md
Outdated
------------------ PUBLISH ------------------- | ||
|
||
topic: mytopic | ||
content-type: application/json; charset=utf-8 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
content-type: -> Content Type:
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
mqtt-transport-binding.md
Outdated
|
||
#### 3.2.3. Metadata Headers | ||
|
||
For MQTT 5.0, implementations MAY include the same MQTT PUBLISH user properties |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
User Properties
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
mqtt-transport-binding.md
Outdated
``` text | ||
------------------ PUBLISH ------------------- | ||
|
||
topic: mytopic |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
topic: -> Topic Name:
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
mqtt-transport-binding.md
Outdated
------------------ PUBLISH ------------------- | ||
|
||
topic: mytopic | ||
content-type: application/json; charset=utf-8 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
content-type: -> Content Type:
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
mqtt-transport-binding.md
Outdated
[CE]: ./spec.md | ||
[JSON-format]: ./json-format.md | ||
[OASIS-MQTT-3.1.1]: http://docs.oasis-open.org/mqtt/mqtt/v3.1.1/mqtt-v3.1.1html | ||
[OASIS-MQTT-5]: http://docs.oasis-open.org/mqtt/mqtt/5.0.0/mqtt-5.0.0.html |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed
[RFC2046]: https://tools.ietf.org/html/rfc2046 | ||
[RFC2119]: https://tools.ietf.org/html/rfc2119 | ||
[RFC3629]: https://tools.ietf.org/html/rfc3629 | ||
[RFC4627]: https://tools.ietf.org/html/rfc4627 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add: [RFC7159] https://tools.ietf.org/html/rfc7159
[CloudEvents][CE] is a standardized and transport-neutral definition of the | ||
structure and metadata description of events. This specification defines how | ||
the elements defined in the CloudEvents specification are to be used in | ||
MQTT PUBLISH ([3.1.1][3-publish], [5.0][5-publish]) messages. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fix links
|
||
This specification does not prescribe rules constraining transfer or | ||
settlement of event messages with MQTT; it solely defines how CloudEvents | ||
are expressed as MQTT PUBLISH messages ([3.1.1][3-publish], [5.0][5-publish]). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fix links
|
||
#### 3.2.1. MQTT Content Type | ||
|
||
For MQTT 5.0, the [MQTT PUBLISH message's `Content Type`][5-content-type] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Change [MQTT ..... to MQTT..... [`Content
Not sure if this is by intention but within the documents there are different notations for content type: |
3.1.4 Examples - I would suggest to use a mapping table between MQTT V5 PUBLISH message fields and the content of the cloud event |
3.2.4 Examples - I would prefer two examples - one for MQTT 3.1.1 and one for MQTT 5.0 |
3.2.3. Metadata Headers - I would vote for SHOULD instead of MAY - to keep it as close as possible to the binary content mode |
@jwende I've addressed your comments in an update, mostly with clarifications. Exception: I left "MAY" stand for the moment, mostly because I've got "MAY" in all bindings and if we change that I want to make it one change and I want the group to agree to us duplicating the metadata. |
@clemensv thanks. Will take a look later today. |
@clemensv following the call, would be good to have the same attribute names (in binary mode) for all transport, seems like HTTP and MQTT attr names dont match, i would like to avoid attribute+transport specific consumer logic |
@clemensv provided an overview during today's call. Unless there are an objections, the plan is to see if we can merge this during next week's call and then deal with any issues/questions in follow-on PRs. So please review this PR before next week's call. |
Signed-off-by: Clemens Vasters <clemensv@microsoft.com>
@clemensv I rebased (and fixed the conflict in Makefile) for you - hope that's ok. |
Approved on the 5/31 call |
Note - if there are any follow-on changes people want to make, please open up a PR with the suggested wording you'd like to see. |
Proposed MQTT 3.1.1 and 5.0 transport binding, analogous to the same for HTTP and AMQP. This includes the same JSON mapping as the HTTP PR for completeness and the JSON mapping should be discussed there, since HTTP has higher priority.
Signed-off-by: Clemens Vasters clemensv@microsoft.com