{"action":"created","comment":{"url":"https://api.github.com/repos/cloudevents/spec/pulls/comments/183096378","pull_request_review_id":114034270,"id":183096378,"diff_hunk":"@@ -0,0 +1,272 @@\n+# MQTT Transport Binding for Cloud Events\n+\n+## Abstract\n+\n+The MQTT Transport Binding for Cloud Events defines how events are mapped to\n+MQTT 3.1.1 ([OASIS][OASIS-MQTT-3.1.1]; ISO/IEC 20922:2016) and MQTT 5.0\n+([OASIS][OASIS-MQTT-5]) messages.\n+\n+## Status of this document\n+\n+This document is a working draft.\n+\n+## Table of Contents\n+\n+1. [Introduction](#1-introduction)\n+- 1.1. [Conformance](#11-conformance)\n+- 1.2. [Relation to MQTT](#12-relation-to-mqtt)\n+- 1.3. [Content Modes](#13-content-modes)\n+- 1.4. [Event Formats](#14-event-formats)\n+- 1.5. [Security](#15-security)\n+2. [Use of Cloud Events Attributes](#2-use-of-cloud-events-attributes)\n+- 2.1. [contentType Attribute](#21-contenttype-attribute)\n+- 2.2. [data Attribute](#22-data-attribute)\n+3. [MQTT PUBLISH Message Mapping](#3-mqtt-publish-message-mapping)\n+- 3.2. [Binary Content Mode](#31-binary-content-mode)\n+- 3.1. [Structured Content Mode](#32-structured-content-mode)\n+4. [References](#4-references)\n+\n+## 1. Introduction\n+\n+[Cloud Events][CE] is a standardized and transport-neutral definition of the\n+structure and metadata description of events. This specification defines how\n+the elements defined in the Cloud Events specification are to be used in\n+MQTT PUBLISH ([3.1.1][3-publish], [5.0][5-publish]) messages.\n+\n+### 1.1. Conformance\n+\n+The key words \"MUST\", \"MUST NOT\", \"REQUIRED\", \"SHALL\", \"SHALL NOT\", \"SHOULD\",\n+\"SHOULD NOT\", \"RECOMMENDED\", \"MAY\", and \"OPTIONAL\" in this document are to be\n+interpreted as described in [RFC2119][RFC2119].\n+\n+### 1.2. Relation to MQTT\n+\n+This specification does not prescribe rules constraining transfer or\n+settlement of event messages with MQTT; it solely defines how Cloud Events\n+are expressed as MQTT PUBLISH messages ([3.1.1][3-publish], [5.0][5-publish]).\n+\n+### 1.3. Content Modes\n+\n+The specification defines two content modes for transferring events:\n+*structured* and *binary*.\n+\n+The *binary* mode *only* applies to MQTT 5.0, because of MQTT 3.1.1's lack of\n+support for custom metadata.\n+\n+In the *structured* content mode, event metadata attributes and event data are\n+placed into the MQTT PUBLISH message payload section\n+using an [event format](#14-event-formats).\n+\n+In the *binary* content mode, the value of the event `data` attribute is placed\n+into the MQTT PUBLISH message's payload section as-is, with\n+the `contentType` attribute value declaring its media type; all other event\n+attributes are mapped to the MQTT PUBLISH message's\n+[properties section][5-publish-properties].\n+\n+### 1.4. Event Formats\n+\n+Event formats, used with the *stuctured* content mode, define how an event is\n+expressed in a particular data format. All implementations of this\n+specification MUST support the [JSON event format][JSON-format].\n+\n+MQTT 5.0 implementations MAY support any additional, including proprietary,\n+formats.\n+\n+### 1.5. Security\n+\n+This specification does not introduce any new security features for MQTT, or\n+mandate specific existing features to be used.\n+\n+## 2. Use of Cloud Events Attributes\n+\n+This specification does not further define any of the [Cloud Events][CE] event\n+attributes.\n+\n+Two of the event attributes, `contentType` and `data` are handled specially\n+and mapped onto MQTT constructs, all other attributes are transferred as\n+metadata without further interpretation.\n+\n+This mapping is intentionally robust against changes, including the addition\n+and removal of event attributes, and also accommodates vendor extensions to the\n+event metadata. Any mention of event attributes other than `contentType` and\n+`data` is exemplary.\n+\n+### 2.1. contentType Attribute\n+\n+The `contentType` attribute is assumed to contain a [RFC2046][RFC2046]\n+compliant media-type expression.\n+\n+### 2.2. data Attribute\n+\n+The `data` attribute is assumed to contain opaque application data that is\n+encoded as declared by the `contentType` attribute.\n+\n+An application is free to hold the information in any in-memory representation\n+of its choosing, but as the value is transposed into MQTT as defined in this\n+specification, the assumption is that the `data` attribute value is made\n+available as a sequence of bytes.\n+\n+For instance, if the declared `contentType` is\n+`application/json;charset=utf-8`, the expectation is that the `data` attribute\n+value is made available as [UTF-8][RFC3629] encoded JSON text for use in\n+AMQP.\n+\n+## 3. MQTT PUBLISH Message Mapping\n+\n+With MQTT 5.0, the content mode is chosen by the sender of the event. Gestures\n+that might allow solicitation of events using a particular mode might be\n+defined by an application, but are not defined here.\n+\n+The receiver of the event can distinguish between the two modes by inspecting","path":"mqtt-transport-binding.md","position":120,"original_position":120,"commit_id":"db3c9f8e8f902269aaee09d420166225c0a75bf4","original_commit_id":"db3c9f8e8f902269aaee09d420166225c0a75bf4","user":{"login":"lfourie","id":6267306,"avatar_url":"https://avatars3.githubusercontent.com/u/6267306?v=4","gravatar_id":"","url":"https://api.github.com/users/lfourie","html_url":"https://github.com/lfourie","followers_url":"https://api.github.com/users/lfourie/followers","following_url":"https://api.github.com/users/lfourie/following{/other_user}","gists_url":"https://api.github.com/users/lfourie/gists{/gist_id}","starred_url":"https://api.github.com/users/lfourie/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lfourie/subscriptions","organizations_url":"https://api.github.com/users/lfourie/orgs","repos_url":"https://api.github.com/users/lfourie/repos","events_url":"https://api.github.com/users/lfourie/events{/privacy}","received_events_url":"https://api.github.com/users/lfourie/received_events","type":"User","site_admin":false},"body":"change to \"two content modes\"","created_at":"2018-04-20T15:57:24Z","updated_at":"2018-04-20T15:57:24Z","html_url":"https://github.com/cloudevents/spec/pull/158#discussion_r183096378","pull_request_url":"https://api.github.com/repos/cloudevents/spec/pulls/158","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/cloudevents/spec/pulls/comments/183096378"},"html":{"href":"https://github.com/cloudevents/spec/pull/158#discussion_r183096378"},"pull_request":{"href":"https://api.github.com/repos/cloudevents/spec/pulls/158"}}},"pull_request":{"url":"https://api.github.com/repos/cloudevents/spec/pulls/158","id":181246103,"html_url":"https://github.com/cloudevents/spec/pull/158","diff_url":"https://github.com/cloudevents/spec/pull/158.diff","patch_url":"https://github.com/cloudevents/spec/pull/158.patch","issue_url":"https://api.github.com/repos/cloudevents/spec/issues/158","number":158,"state":"open","locked":false,"title":"MQTT 3.1.1 and 5.0 transport binding","user":{"login":"clemensv","id":542030,"avatar_url":"https://avatars0.githubusercontent.com/u/542030?v=4","gravatar_id":"","url":"https://api.github.com/users/clemensv","html_url":"https://github.com/clemensv","followers_url":"https://api.github.com/users/clemensv/followers","following_url":"https://api.github.com/users/clemensv/following{/other_user}","gists_url":"https://api.github.com/users/clemensv/gists{/gist_id}","starred_url":"https://api.github.com/users/clemensv/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/clemensv/subscriptions","organizations_url":"https://api.github.com/users/clemensv/orgs","repos_url":"https://api.github.com/users/clemensv/repos","events_url":"https://api.github.com/users/clemensv/events{/privacy}","received_events_url":"https://api.github.com/users/clemensv/received_events","type":"User","site_admin":false},"body":"Proposed MQTT 3.1.1 and 5.0 transport binding, analogous to the same for [HTTP](https://github.com/cloudevents/spec/pull/148) 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.\r\n\r\nSigned-off-by: Clemens Vasters <clemensv@microsoft.com>","created_at":"2018-04-12T15:42:19Z","updated_at":"2018-04-20T15:57:24Z","closed_at":null,"merged_at":null,"merge_commit_sha":"c17186a5389347480a5b57a707ffeb322f89bcad","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/cloudevents/spec/pulls/158/commits","review_comments_url":"https://api.github.com/repos/cloudevents/spec/pulls/158/comments","review_comment_url":"https://api.github.com/repos/cloudevents/spec/pulls/comments{/number}","comments_url":"https://api.github.com/repos/cloudevents/spec/issues/158/comments","statuses_url":"https://api.github.com/repos/cloudevents/spec/statuses/db3c9f8e8f902269aaee09d420166225c0a75bf4","head":{"label":"clemensv:mqttBinding","ref":"mqttBinding","sha":"db3c9f8e8f902269aaee09d420166225c0a75bf4","user":{"login":"clemensv","id":542030,"avatar_url":"https://avatars0.githubusercontent.com/u/542030?v=4","gravatar_id":"","url":"https://api.github.com/users/clemensv","html_url":"https://github.com/clemensv","followers_url":"https://api.github.com/users/clemensv/followers","following_url":"https://api.github.com/users/clemensv/following{/other_user}","gists_url":"https://api.github.com/users/clemensv/gists{/gist_id}","starred_url":"https://api.github.com/users/clemensv/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/clemensv/subscriptions","organizations_url":"https://api.github.com/users/clemensv/orgs","repos_url":"https://api.github.com/users/clemensv/repos","events_url":"https://api.github.com/users/clemensv/events{/privacy}","received_events_url":"https://api.github.com/users/clemensv/received_events","type":"User","site_admin":false},"repo":{"id":122228743,"name":"spec","full_name":"clemensv/spec","owner":{"login":"clemensv","id":542030,"avatar_url":"https://avatars0.githubusercontent.com/u/542030?v=4","gravatar_id":"","url":"https://api.github.com/users/clemensv","html_url":"https://github.com/clemensv","followers_url":"https://api.github.com/users/clemensv/followers","following_url":"https://api.github.com/users/clemensv/following{/other_user}","gists_url":"https://api.github.com/users/clemensv/gists{/gist_id}","starred_url":"https://api.github.com/users/clemensv/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/clemensv/subscriptions","organizations_url":"https://api.github.com/users/clemensv/orgs","repos_url":"https://api.github.com/users/clemensv/repos","events_url":"https://api.github.com/users/clemensv/events{/privacy}","received_events_url":"https://api.github.com/users/clemensv/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/clemensv/spec","description":"CloudEvents Specification","fork":true,"url":"https://api.github.com/repos/clemensv/spec","forks_url":"https://api.github.com/repos/clemensv/spec/forks","keys_url":"https://api.github.com/repos/clemensv/spec/keys{/key_id}","collaborators_url":"https://api.github.com/repos/clemensv/spec/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/clemensv/spec/teams","hooks_url":"https://api.github.com/repos/clemensv/spec/hooks","issue_events_url":"https://api.github.com/repos/clemensv/spec/issues/events{/number}","events_url":"https://api.github.com/repos/clemensv/spec/events","assignees_url":"https://api.github.com/repos/clemensv/spec/assignees{/user}","branches_url":"https://api.github.com/repos/clemensv/spec/branches{/branch}","tags_url":"https://api.github.com/repos/clemensv/spec/tags","blobs_url":"https://api.github.com/repos/clemensv/spec/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/clemensv/spec/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/clemensv/spec/git/refs{/sha}","trees_url":"https://api.github.com/repos/clemensv/spec/git/trees{/sha}","statuses_url":"https://api.github.com/repos/clemensv/spec/statuses/{sha}","languages_url":"https://api.github.com/repos/clemensv/spec/languages","stargazers_url":"https://api.github.com/repos/clemensv/spec/stargazers","contributors_url":"https://api.github.com/repos/clemensv/spec/contributors","subscribers_url":"https://api.github.com/repos/clemensv/spec/subscribers","subscription_url":"https://api.github.com/repos/clemensv/spec/subscription","commits_url":"https://api.github.com/repos/clemensv/spec/commits{/sha}","git_commits_url":"https://api.github.com/repos/clemensv/spec/git/commits{/sha}","comments_url":"https://api.github.com/repos/clemensv/spec/comments{/number}","issue_comment_url":"https://api.github.com/repos/clemensv/spec/issues/comments{/number}","contents_url":"https://api.github.com/repos/clemensv/spec/contents/{+path}","compare_url":"https://api.github.com/repos/clemensv/spec/compare/{base}...{head}","merges_url":"https://api.github.com/repos/clemensv/spec/merges","archive_url":"https://api.github.com/repos/clemensv/spec/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/clemensv/spec/downloads","issues_url":"https://api.github.com/repos/clemensv/spec/issues{/number}","pulls_url":"https://api.github.com/repos/clemensv/spec/pulls{/number}","milestones_url":"https://api.github.com/repos/clemensv/spec/milestones{/number}","notifications_url":"https://api.github.com/repos/clemensv/spec/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/clemensv/spec/labels{/name}","releases_url":"https://api.github.com/repos/clemensv/spec/releases{/id}","deployments_url":"https://api.github.com/repos/clemensv/spec/deployments","created_at":"2018-02-20T17:07:29Z","updated_at":"2018-04-06T16:34:16Z","pushed_at":"2018-04-20T06:44:09Z","git_url":"git://github.com/clemensv/spec.git","ssh_url":"git@github.com:clemensv/spec.git","clone_url":"https://github.com/clemensv/spec.git","svn_url":"https://github.com/clemensv/spec","homepage":"","size":26436,"stargazers_count":0,"watchers_count":0,"language":"Shell","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":1,"mirror_url":null,"archived":false,"open_issues_count":0,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0"},"forks":1,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"cloudevents:master","ref":"master","sha":"39a1dbde5ee9160131c62d4947f2a29780c8c3ac","user":{"login":"cloudevents","id":32076828,"avatar_url":"https://avatars2.githubusercontent.com/u/32076828?v=4","gravatar_id":"","url":"https://api.github.com/users/cloudevents","html_url":"https://github.com/cloudevents","followers_url":"https://api.github.com/users/cloudevents/followers","following_url":"https://api.github.com/users/cloudevents/following{/other_user}","gists_url":"https://api.github.com/users/cloudevents/gists{/gist_id}","starred_url":"https://api.github.com/users/cloudevents/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cloudevents/subscriptions","organizations_url":"https://api.github.com/users/cloudevents/orgs","repos_url":"https://api.github.com/users/cloudevents/repos","events_url":"https://api.github.com/users/cloudevents/events{/privacy}","received_events_url":"https://api.github.com/users/cloudevents/received_events","type":"Organization","site_admin":false},"repo":{"id":113701924,"name":"spec","full_name":"cloudevents/spec","owner":{"login":"cloudevents","id":32076828,"avatar_url":"https://avatars2.githubusercontent.com/u/32076828?v=4","gravatar_id":"","url":"https://api.github.com/users/cloudevents","html_url":"https://github.com/cloudevents","followers_url":"https://api.github.com/users/cloudevents/followers","following_url":"https://api.github.com/users/cloudevents/following{/other_user}","gists_url":"https://api.github.com/users/cloudevents/gists{/gist_id}","starred_url":"https://api.github.com/users/cloudevents/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cloudevents/subscriptions","organizations_url":"https://api.github.com/users/cloudevents/orgs","repos_url":"https://api.github.com/users/cloudevents/repos","events_url":"https://api.github.com/users/cloudevents/events{/privacy}","received_events_url":"https://api.github.com/users/cloudevents/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/cloudevents/spec","description":"CloudEvents Specification","fork":false,"url":"https://api.github.com/repos/cloudevents/spec","forks_url":"https://api.github.com/repos/cloudevents/spec/forks","keys_url":"https://api.github.com/repos/cloudevents/spec/keys{/key_id}","collaborators_url":"https://api.github.com/repos/cloudevents/spec/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/cloudevents/spec/teams","hooks_url":"https://api.github.com/repos/cloudevents/spec/hooks","issue_events_url":"https://api.github.com/repos/cloudevents/spec/issues/events{/number}","events_url":"https://api.github.com/repos/cloudevents/spec/events","assignees_url":"https://api.github.com/repos/cloudevents/spec/assignees{/user}","branches_url":"https://api.github.com/repos/cloudevents/spec/branches{/branch}","tags_url":"https://api.github.com/repos/cloudevents/spec/tags","blobs_url":"https://api.github.com/repos/cloudevents/spec/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/cloudevents/spec/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/cloudevents/spec/git/refs{/sha}","trees_url":"https://api.github.com/repos/cloudevents/spec/git/trees{/sha}","statuses_url":"https://api.github.com/repos/cloudevents/spec/statuses/{sha}","languages_url":"https://api.github.com/repos/cloudevents/spec/languages","stargazers_url":"https://api.github.com/repos/cloudevents/spec/stargazers","contributors_url":"https://api.github.com/repos/cloudevents/spec/contributors","subscribers_url":"https://api.github.com/repos/cloudevents/spec/subscribers","subscription_url":"https://api.github.com/repos/cloudevents/spec/subscription","commits_url":"https://api.github.com/repos/cloudevents/spec/commits{/sha}","git_commits_url":"https://api.github.com/repos/cloudevents/spec/git/commits{/sha}","comments_url":"https://api.github.com/repos/cloudevents/spec/comments{/number}","issue_comment_url":"https://api.github.com/repos/cloudevents/spec/issues/comments{/number}","contents_url":"https://api.github.com/repos/cloudevents/spec/contents/{+path}","compare_url":"https://api.github.com/repos/cloudevents/spec/compare/{base}...{head}","merges_url":"https://api.github.com/repos/cloudevents/spec/merges","archive_url":"https://api.github.com/repos/cloudevents/spec/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/cloudevents/spec/downloads","issues_url":"https://api.github.com/repos/cloudevents/spec/issues{/number}","pulls_url":"https://api.github.com/repos/cloudevents/spec/pulls{/number}","milestones_url":"https://api.github.com/repos/cloudevents/spec/milestones{/number}","notifications_url":"https://api.github.com/repos/cloudevents/spec/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/cloudevents/spec/labels{/name}","releases_url":"https://api.github.com/repos/cloudevents/spec/releases{/id}","deployments_url":"https://api.github.com/repos/cloudevents/spec/deployments","created_at":"2017-12-09T21:18:13Z","updated_at":"2018-04-20T15:57:18Z","pushed_at":"2018-04-20T15:57:13Z","git_url":"git://github.com/cloudevents/spec.git","ssh_url":"git@github.com:cloudevents/spec.git","clone_url":"https://github.com/cloudevents/spec.git","svn_url":"https://github.com/cloudevents/spec","homepage":"","size":26399,"stargazers_count":94,"watchers_count":94,"language":"Shell","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":34,"mirror_url":null,"archived":false,"open_issues_count":49,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0"},"forks":34,"open_issues":49,"watchers":94,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/cloudevents/spec/pulls/158"},"html":{"href":"https://github.com/cloudevents/spec/pull/158"},"issue":{"href":"https://api.github.com/repos/cloudevents/spec/issues/158"},"comments":{"href":"https://api.github.com/repos/cloudevents/spec/issues/158/comments"},"review_comments":{"href":"https://api.github.com/repos/cloudevents/spec/pulls/158/comments"},"review_comment":{"href":"https://api.github.com/repos/cloudevents/spec/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/cloudevents/spec/pulls/158/commits"},"statuses":{"href":"https://api.github.com/repos/cloudevents/spec/statuses/db3c9f8e8f902269aaee09d420166225c0a75bf4"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"lfourie"}}