Skip to content

Commit

Permalink
Size limits or guarantees
Browse files Browse the repository at this point in the history
Signed-off-by: Christoph Neijenhuis <christoph.neijenhuis@commercetools.de>
  • Loading branch information
cneijenhuis committed Jan 9, 2019
1 parent 5a7c1cf commit 37ea87e
Showing 1 changed file with 27 additions and 0 deletions.
27 changes: 27 additions & 0 deletions spec.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ This document is a working draft.
- [Type System](#type-system)
- [Context Attributes](#context-attributes)
- [Data Attribute](#data-attribute)
- [Size Limits](#size-limits)
- [Example](#example)

## Overview
Expand Down Expand Up @@ -289,6 +290,32 @@ encapsulated within the `data` attribute.
* Constraints:
* OPTIONAL

# Size Limits

In order to increase interoperability, the following size limits apply to any
CloudEvent:

* The CloudEvent serialized as JSON (minified, i.e. without white-space) MUST
NOT exceed a size of 128KB.
* The CloudEvent MUST NOT have more than 100 top-level attributes.

CloudEvent producers SHOULD only create CloudEvents within these limits.
CloudEvent consumers MUST accept all CloudEvents within these limits and SHOULD
reject messages that violate these limits.

# Size Guarantees // Another option

In order to increase interoperability, all CloudEvent consumers MUST accept
messages up to the following sizes:

* The CloudEvent serialized as JSON (minified, i.e. without white-space) does
not exceed a size of 128KB.
* The CloudEvent does not have more than 100 top-level attributes.

It is RECOMMENDED for CloudEvent producers to only create CloudEvents within
these limits, unless they can be sure all consumers support larger sizes.
CloudEvent consumers MAY reject messages that violate these limits.

# Example

The following example shows a CloudEvent serialized as JSON:
Expand Down

0 comments on commit 37ea87e

Please sign in to comment.