From 37ea87e62eda25531c75b77a657940247083e117 Mon Sep 17 00:00:00 2001 From: Christoph Neijenhuis Date: Wed, 9 Jan 2019 17:55:26 +0100 Subject: [PATCH] Size limits or guarantees Signed-off-by: Christoph Neijenhuis --- spec.md | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/spec.md b/spec.md index b17709129..58011b2f8 100644 --- a/spec.md +++ b/spec.md @@ -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 @@ -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: