22
33## Abstract
44
5- The AMQP Format for CloudEvents defines how event attributes are expressed in
6- the [ AMQP 1.0 Type System] [ type-system ] .
5+ The AMQP Format for CloudEvents defines how event attributes and payload data
6+ are expressed in the [ AMQP 1.0 Type System] [ type-system ] .
77
88## Status of this document
99
@@ -13,7 +13,8 @@ This document is a working draft.
1313
14141 . [ Introduction] ( #1-introduction )
15152 . [ Attributes] ( #2-attributes )
16- 3 . [ References] ( #3-references )
16+ 3 . [ Data] ( #3-data )
17+ 4 . [ References] ( #4-references )
1718
1819## 1. Introduction
1920
@@ -55,13 +56,13 @@ exceptions noted below.
5556
5657| CloudEvents | AMQP |
5758| ------------- | --------------------------- |
58- | String | [ string ] [ amqp-string ] |
59+ | Boolean | [ boolean ] [ amqp-boolean ] |
5960| Integer | [ long] [ amqp-long ] |
61+ | String | [ string] [ amqp-string ] |
6062| Binary | [ binary] [ amqp-binary ] |
6163| URI | [ string] [ amqp-string ] |
6264| URI-reference | [ string] [ amqp-string ] |
6365| Timestamp | [ timestamp] [ amqp-timestamp ] |
64- | Any | See 2.3. |
6566
6667A CloudEvents AMQP format implementation MUST allow for attribute values to be
6768convertible from/to their canonical CloudEvents string representation. For
@@ -88,14 +89,21 @@ any revision of such a specification, MUST also define explicit mapping rules
8889for all other event formats that are part of the CloudEvents core at the time of
8990the submission or revision.
9091
91- ### 2.3. Mapping Any-typed Attributes
92+ ## 3. Data
93+
94+ Before encoding, the AMQP serializer MUST first determine the runtime data type
95+ of the data content. This may be determined by examining the data for characters
96+ outside the UTF-8 range or by consulting the ` datacontenttype ` attribute.
97+
98+ If the implementation determines that the type of the data is binary, the value
99+ MUST be stored in the payload as a single [ AMQP data] [ amqp-data ] section.
92100
93- ` Any ` -typed CloudEvents values can either hold a ` String ` , or a ` Binary ` value,
94- or a ` Map ` . ` Map ` entry values are also ` Any ` typed. AMQP's type system natively
95- represents dynamic typing in its [ type system encoding ] [ type-system-encoding ] ,
96- and therefore immediately allows for the required variant type representation .
101+ For other types (non-binary data without a ` datacontenttype ` attribute), the
102+ implementation MUST translate the data value into an [ AMQP type
103+ system ] [ type-system ] value and the value MUST be stored in an [ AMQP
104+ value ] [ amqp-value ] section .
97105
98- ## 3 . References
106+ ## 4 . References
99107
100108- [ RFC2046] [ rfc2046 ] Multipurpose Internet Mail Extensions (MIME) Part Two:
101109 Media Types
@@ -109,21 +117,25 @@ and therefore immediately allows for the required variant type representation.
109117 https://docs.oasis-open.org/amqp/core/v1.0/os/amqp-core-types-v1.0-os.html
110118[ type-system-encoding] :
111119 http://docs.oasis-open.org/amqp/core/v1.0/os/amqp-core-types-v1.0-os.html#section-encodings
112- [ amqp-string ] :
113- http://docs.oasis-open.org/amqp/core/v1.0/os/amqp-core-types-v1.0-os.html#type-string
120+ [ amqp-boolean ] :
121+ http://docs.oasis-open.org/amqp/core/v1.0/os/amqp-core-types-v1.0-os.html#type-boolean
114122[ amqp-long] :
115123 http://docs.oasis-open.org/amqp/core/v1.0/os/amqp-core-types-v1.0-os.html#type-long
124+ [ amqp-string] :
125+ http://docs.oasis-open.org/amqp/core/v1.0/os/amqp-core-types-v1.0-os.html#type-string
116126[ amqp-binary] :
117127 http://docs.oasis-open.org/amqp/core/v1.0/os/amqp-core-types-v1.0-os.html#type-binary
118128[ amqp-timestamp] :
119129 http://docs.oasis-open.org/amqp/core/v1.0/os/amqp-core-types-v1.0-os.html#type-timestamp
120- [ amqp-map ] :
121- http://docs.oasis-open.org/amqp/core/v1.0/os/amqp-core-types -v1.0-os.html#type-map
122- [ amqp-describedtype ] :
123- http://docs.oasis-open.org/amqp/core/v1.0/os/amqp-core-types -v1.0-os.html#doc-idp38080
130+ [ amqp-data ] :
131+ http://docs.oasis-open.org/amqp/core/v1.0/os/amqp-core-messaging -v1.0-os.html#type-data
132+ [ amqp-value ] :
133+ http://docs.oasis-open.org/amqp/core/v1.0/os/amqp-core-messaging -v1.0-os.html#type-value
124134[ rfc2046 ] : https://tools.ietf.org/html/rfc2046
125135[ rfc2119 ] : https://tools.ietf.org/html/rfc2119
126136[ rfc4627 ] : https://tools.ietf.org/html/rfc4627
127137[ rfc4648 ] : https://tools.ietf.org/html/rfc4648
128138[ rfc6839 ] : https://tools.ietf.org/html/rfc6839#section-3.1
129139[ rfc8259 ] : https://tools.ietf.org/html/rfc8259
140+ [ oasis-amqp-1.0] :
141+ http://docs.oasis-open.org/amqp/core/v1.0/os/amqp-core-overview-v1.0-os.html
0 commit comments