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

Optional event id #422

Closed
wants to merge 6 commits into from
Closed
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
44 changes: 30 additions & 14 deletions spec.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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.
Copy link
Contributor

Choose a reason for hiding this comment

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

The Design Goal section states:

CloudEvents are typically used in a distributed system to allow for services to be loosely coupled during development, deployed independently, and later can be connected to create new applications.

In a loosely coupled system, a producer can't tell if de-duplication is not required (otherwise they're strongly coupled), and even if it could - can the producer tell that if it is later connected to create a new application, de-duplication won't be required in the future?

- 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

Expand Down