Comments (17)
This is related to the question I raised in last week's meeting. For this case, is the SaaS application the event source or API GW the event source? If API GW is the event source, event data from SaaS Application should be the payload of the API GW event (the Alternative 1) and some metadata needs to be added to the API GW event metadata fields so that the event consumer knows how to extract needed info from the SaaS data.
from spec.
With the HTTP/JSON structured format, where the content type is "application/cloudevents+json", I would think that a nested CE would have its CE contentType
property set to "app/ce+json" and then data
would be the nested CE as json. no? If so, is there anything to formalize in the spec about this or would perhaps adding a sample be sufficient?
from spec.
Yes, that sounds like a good solution. What do you think, @cathyhongzhang ?
from spec.
Related to #87 ?
from spec.
@deissnerk what are your thoughts on this one? If an example is sufficient, would you be interested in creating a PR?
from spec.
@duglin I think that the case I brought up, may not be that relevant in practice. The event on the API gateway is probably not worth wrapping into a CloudEvent on its own. Nevertheless there might be cases, when people decide to nest CloudEvents for whatever reason. So having an example makes sense.
I can create a PR with an example outlining the idea you brought up. It might take a few weeks, though.
from spec.
ok thanks
from spec.
@deissnerk any update on this one?
from spec.
@deissnerk can we close this one or do you think we need to add some text in the primer to explain how people could put a CE into the data
attribute of an existing CE (if they wanted)?
from spec.
@duglin I was just about to create an example according to your proposal above. It turns out, that this does not work, if you put a nested event inside an event that is sent using http binary mode. Our http protocol binding states:
The receiver of the event can distinguish between the three modes by inspecting the Content-Type header value. If the value is prefixed with the CloudEvents media type application/cloudevents, indicating the use of a known event format, the receiver uses structured mode. If the value is prefixed with application/cloudevents-batch, the receiver uses the batched mode. Otherwise it defaults to binary mode.
By this rule, a receiver will retrieve the inner event only. If you send an outer event in binary mode with content type "application/cloudevents+json", the event context in the http header will be ignored. I just checked this with the go sdk.
Does that mean we should advise people, that nesting is only possible, if you do not mix binary and structured mode?
from spec.
Just to be clear, we're talking about how this:
Content-Type: application/cloudevents+json
ce-specversion: 1.0
ce-type: myevent
ce-id: 1234-1234-1234
ce-source: example.com
{
"specversion": "1.0",
"type": "coolevent",
"id": "xxxx-xxxx-xxxx",
"source": "bigco.com",
"data": { ... }
}
is ambiguous, right?
I wonder if it wouldn't make more sense to change the spec slightly to talk about how checking for ce-specversion
HTTP header might be the better choice. The text in there is non-normative :-)
from spec.
@duglin Yes, that's the case I was talking about. I agree, it would be more consistent to adjust the spec as you proposed. I'm just not sure, if that is still possible. Is this not normative?
By the way, there is still the document status:
This document is a working draft.
from spec.
Well, in general there is normative text in there, but unless I'm missing it I don't see any normative text that mandate how people determine binary vs structured.
I'll PR the "working draft" thing :-)
from spec.
@duglin I see your point. There is no MUST, SHOULD etc. It will nevertheless have an impact on implementations. I only checked the go-sdk so far, but I would expect others distinguish structured and binary the same way.
from spec.
I agree it would impact implementations, but from a spec perspective I think we could modify the text to talk about using the ce-specversion
header instead of Content-Type
w/o requiring a version bump.
from spec.
@deissnerk any update on this one?
from spec.
This would be the way to do it:
Content-Type: application/json
ce-specversion: 1.0
ce-type: myevent
ce-id: 1234-1234-1234
ce-source: example.com
{
"specversion": "1.0",
"type": "coolevent",
"id": "xxxx-xxxx-xxxx",
"source": "bigco.com",
"data": { ... }
}
from spec.
Related Issues (20)
- Add a documented extension for expiring events HOT 4
- Update SDK support status for RocketMQ binding
- Singular attribute extensions w/REQUIRED seems odd HOT 2
- datacontenttype should be an attribute HOT 6
- Discussion of the meaning of optional HOT 7
- Add kubewatch from robusta.dev to adopters HOT 3
- Filters HOT 1
- Propal: Program Binding for CloudEvents HOT 18
- sql filter: clarification of non-boolean cesql expression result coercion to a boolean HOT 12
- Expand the CESQL tck tests HOT 2
- Clarify whether missing attributes should return an `error` or `false` HOT 5
- CESQL: clarify behaviours of errors in OR expressions HOT 1
- CESQL: clarify `TRUE` and `true`, `FALSE` and `false` are the same HOT 3
- Setup snyk for SDKs HOT 3
- Add text (primer?) to discuss our stance on security HOT 1
- Proposal for keeping English and translated docs in sync HOT 4
- Create an issue for CE xsi type HOT 1
- Add @GrahamCampbell to @sdk-php-maintainers HOT 2
- [Question] How to propose "Protocol binding" for new message broker? HOT 5
- Clean-up our OSS page HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from spec.