diff --git a/spec.md b/spec.md index 7f5d5b465..3d250ee0e 100644 --- a/spec.md +++ b/spec.md @@ -190,18 +190,28 @@ within the same JSON object. ### source - Type: `URI-reference` -- Description: This describes the event producer. Often this will include - information such as the type of the event source, the organization publishing - the event, the process that produced the event, and some unique identifiers. - The exact syntax and semantics behind the data encoded in the URI is event - producer defined. +- Description: Identifies the event producer. Often this will include + information such as the type of the event source, the organization + publishing the event, the process that produced the event, and some unique + identifiers. The exact syntax and semantics behind the data encoded in the URI + is event producer defined. + + An application MUST assign a distinct `source` to each distinct producer. + The application MAY use UUIDs, URNs, DNS authorities or an application-specific + scheme to create unique identifiers. + - Constraints: - REQUIRED - Examples - - https://github.com/cloudevents/spec/pull - - /cloudevents/spec/pull - - urn:event:from:myapi/resource - - mailto:cncf-wg-serverless@lists.cncf.io + - Internet-wide unique URI with a DNS authority. + - https://github.com/cloudevents/spec/pull/123 + - mailto:cncf-wg-serverless@lists.cncf.io + - Universally-unique URN with a UUID: + - urn:uuid:6e8bc430-9c3a-11d9-9669-0800200c9a66 + - Application-specific identifiers + - /cloudevents/spec/pull/123 + - /sensors/tn-1234567/alerts + - 1-555-123-4567 ### subject @@ -236,14 +246,20 @@ within the same JSON object. ### id - Type: `String` -- Description: ID of the event. The semantics of this string are explicitly - undefined to ease the implementation of producers. Enables deduplication. +- Description: Optionally identifies an event for de-duplication. + Absent if de-duplication is not required. + If present, the `source` and `id` attributes together uniquely identify the event. - Examples: + - An event counter maintained by the producer - A database commit ID + - A UUID - Constraints: - - REQUIRED - - MUST be a non-empty string - - MUST be unique within the scope of the producer + - OPTIONAL + - Producers MAY omit `id` if de-duplication is not required. + - Consumers MUST process events lacking `id` as non-duplicate events. + - If present, MUST be a non-empty string. + - Producers MUST ensure each distinct event from the same `source` has a unique `id` If a duplicate event is re-sent due to a network error, it MAY have the same `id`. + - Consumers MAY assume that events with matching `source` and `id` are duplicates. ### time