question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

CloudEvents additional custom data

See original GitHub issue

So, I am talking with cdEvents who use cloudevents as the underlying transport format, and one thing I noticed is that they have an additional field called payload in their requests.

{
    "specversion" : "1.0",
    "type" : "com.github.pull_request.opened",
    "source" : "https://github.com/cloudevents/spec/pull",
    "subject" : "123",
    "id" : "A234-1234-1234",
    "time" : "2018-04-05T17:31:00Z",
    "comexampleextension1" : "value",
    "comexampleothervalue" : 5,
    "datacontenttype" : "text/xml",
    "data" : "<much wow=\"xml\"/>" // Notice the nesting of the data
}

This unfortunately is a breaking change to anyone adhering to this standard, so instead I proposed some alternative solution in cdEvents#40. The basic idea is making data a top level parent, and introducing something like a cd-events-metadata field in the payload. So instead

<much_wow>
        <somefield>hello world!</somefield>
        <cloud_events_metadata>
                <type>com.github.pull_request.opened</type>
                <source>https://github.com/cloudevents/spec/pull</source>
                <subject>123</subject>
                <time>2018-04-05T17:31:00Z</time>
                <comexampleextension1>value</comexampleextension1>
                <comexampleothervalue>5</comexampleothervalue>
                <id>A234-1234-1234</id>
                <spec-version>1.0</spec-version>
        </cloud_events_metadata>
</much_wow>

But is this possible with cloudevents? Have you guys thought about something like this?

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:6

github_iconTop GitHub Comments

1reaction
afrittolicommented, Jun 15, 2022

@duglin Do you think it would be worth adding some text to the binary mode description to further clarify its purpose?

0reactions
duglincommented, Jul 15, 2022
Read more comments on GitHub >

github_iconTop Results From Across the Web

manage custom attributtes · Issue #77 · cloudevents/sdk-java
When I use the function the field data appears two times in the output so that brings me problems parsing the json object....
Read more >
CloudEvents - JSON event format | Eventarc - Google Cloud
CloudEvents (cloudevents.io) is a specification for describing event data in a common way. The specification is under the Cloud Native ...
Read more >
CloudEvents |
CloudEvents is a specification for describing event data in a common way. CloudEvents seeks to dramatically simplify event declaration and delivery across ...
Read more >
JavaScript SDK for CloudEvents
Serialize and deserialize CloudEvents in different event formats. Send and recieve CloudEvents with via different protocol bindings. Note: Supports CloudEvent ...
Read more >
Sending and Receiving Cloud Events with Kafka - Quarkus
The data attribute contains the wrapped business event. It is an essential part, and the other attributes are just providing details about that ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found