-
Notifications
You must be signed in to change notification settings - Fork 584
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
Introducing "subject" #406
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
# CloudEvents - Version 0.2 | ||
# CloudEvents - Version 0.2 | ||
|
||
## Abstract | ||
|
||
|
@@ -186,20 +186,47 @@ within the same JSON object. | |
- MUST be a non-empty string | ||
|
||
### 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. | ||
- Constraints: | ||
- REQUIRED | ||
- Examples | ||
- https://github.com/cloudevents/spec/pull/123 | ||
- /cloudevents/spec/pull/123 | ||
- urn:event:from:myapi/resourse/123 | ||
- mailto:[email protected] | ||
* Type: `URI-reference` | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
* 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. | ||
* Constraints: | ||
* REQUIRED | ||
* Examples | ||
* https://github.com/cloudevents/spec/pull | ||
* /cloudevents/spec/pull | ||
* urn:event:from:myapi/resource | ||
* mailto:[email protected] | ||
|
||
### subject | ||
* Type: `String` | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Perhaps Subject is a URIRef? and it relates to the source uri? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It's some sort of subject identifier. I can be a filename or just some name of a thing that the source knows. I wouldn't constrain that as much as source. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. URIRef does all:
|
||
* Description: This describes the subject of the event in the context of the | ||
event producer (identified by `source`). In publish-subscribe scenarios, | ||
a subscriber will typically subscribe to events emitted by a `source`, | ||
but the `source` identifier alone might not be sufficient as a qualifier for | ||
any specific event if the `source` context has internal sub-structure. | ||
|
||
Identifying the subject of the event in context metadata (opposed to only in | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. For source, we have these examples:
Would using subject turn them into:
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The last example bring the point home rather nicely. That's exactly what subject is. |
||
the `data` payload) is particularly helpful in generic subscription filtering | ||
scenarios where middleware is unable to interpret the `data` content. In the | ||
above example, the subscriber might only be interested in blobs with names | ||
ending with '.jpg' or '.jpeg' and the subject attribute allows for | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. s/subject/ There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I like this paragraph. Would it be helpful to add something about how putting this info into the "source" URI is just as hard to parse/filter-on ? And that's why we creating this property. Before this property I think people were pushed towards merging it into 'source' - if they wanted it outside of 'data'. Or, if this is too much text for the spec, perhaps in the primer? |
||
constructing a simple and efficient string-suffix filter for that subset of | ||
events. | ||
* Constraints: | ||
* OPTIONAL | ||
* MUST be a non-empty string | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If Present, MUST be a non-empty string There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ok There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. no pushy? |
||
* Example: | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I like this example because it shows how all of the key properties relate to each other, and better explains what people should expect in each. So, can we move this example out from under the definition of this one property so it can be view in the bigger context? And then show "id" and "type" too - or even a total CE. |
||
* A subscriber might register interest for when new blobs are created | ||
inside a blob-storage container. In this case, the event `source` identifies | ||
the subscription scope (storage container), the `type` identifies the "blob | ||
created" event, and the `id` uniquely identifies the event instance to | ||
distinguish separate occurrences of a same-named blob having been created; | ||
the name of the newly created blob is carried in `subject`: | ||
* `source`: https://example.com/storage/tenant/container | ||
* `subject`: mynewfile.jpg | ||
|
||
### id | ||
|
||
|
@@ -372,7 +399,8 @@ The following example shows a CloudEvent serialized as JSON: | |
{ | ||
"specversion" : "0.2", | ||
"type" : "com.github.pull.create", | ||
"source" : "https://github.com/cloudevents/spec/pull/123", | ||
"source" : "https://github.com/cloudevents/spec/pull", | ||
"subject" : "123", | ||
"id" : "A234-1234-1234", | ||
"time" : "2018-04-05T17:31:00Z", | ||
"comexampleextension1" : "value", | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
weird
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The updated version adds a extra whitespace to the end of 0.2.