Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clarify scope of eventID's uniqueness #391

Merged
merged 1 commit into from
May 16, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
47 changes: 35 additions & 12 deletions spec.md
Original file line number Diff line number Diff line change
Expand Up @@ -165,10 +165,14 @@ The following attributes are REQUIRED to be present in all CloudEvents:
#### 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: Identifies the event.
Producers MUST ensure that `source` + `id` is unique for each
distinct event. If a duplicate event is re-sent (e.g. due to a
network error) it MAY have the same `id`. Consumers MAY assume that
Events with identical `source` and `id` are duplicates.
- Examples:
- A database commit ID
- An event counter maintained by the producer
- A UUID
- Constraints:
- REQUIRED
- MUST be a non-empty string
Expand All @@ -177,18 +181,37 @@ The following attributes are REQUIRED to be present in all CloudEvents:
#### 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 context in which an event
happened. Often this will include information such as the type of
the event source, the organization publishing the event or the
process that produced the event. The exact syntax and semantics
behind the data encoded in the URI is defined by the event producer.

Producers MUST ensure that `source` + `id` is unique for each
distinct event.

An application MAY assign a unique `source` to each distinct
producer, which makes it easy to produce unique IDs since no other
producer will have the same source. The application MAY use UUIDs,
URNs, DNS authorities or an application-specific scheme to create
unique `source` identifiers.

A source MAY include more than one producer. In that case the
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is the word "include" the right word? Perhaps "use" or "leverage"? Not a big deal since I think I get the point, but "include" might sound like we're getting include impl details and suggesting that a producer is a sub-component of a source - which it may not be.

producers MUST collaborate to ensure that `source` + `id` is unique
for each distinct event.

- 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
- 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

#### specversion

Expand Down