Skip to content

Updates for binary encoding #8

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

Closed

Conversation

evankanderson
Copy link
Contributor

Updates binary encoding to handle extensions and content-type per spec.

Update marshaller to handle both structured and binary formats. Previously, it would try structured first, even if the content-type did not match, and then ignore all the headers, producing very wimpy events with no data.

  • Link to issue this resolves
    I was too lazy to file an issue while debugging.

  • What I did
    I wrote a small python program using Flask to log cloud events, and to report them in a webpage. I'll be putting in in a pull request to https://github.com/knative/docs soon.

  • How I did it
    I used the following command to POST cloudevents to the flask program I wrote above.

curl -v -d '{}' \
  -H 'CE-SpecVersion: 0.2' \
  -H 'Content-Type: application/json; charset=utf-8' \
  -H 'CE-Source: "http://manual/"' \
  -H 'CE-Type: "local.badidea"' \
  -H 'CE-Id: 123' \
  -H 'CE-Time: "2019-01-11T23:40:00Z"' \
  -H 'CE-test: foo' \
  -H 'CE-test: bar' \
  -H 'CE-sampling: 2' \
  -H 'traceparent: aauau' \
  http://127.0.0.1:5000/
  • How to verify it
    I updated the tests.

  • One line description for the changelog

* Updated library to better support binary encoding

Update marshaller to handle both structured and binary formats.

Signed-off-by: Evan Anderson <evan.k.anderson@gmail.com>
Signed-off-by: Evan Anderson <evan.k.anderson@gmail.com>
evankanderson added a commit to evankanderson/docs that referenced this pull request Jan 12, 2019
Signed-off-by: Evan Anderson <evan.k.anderson@gmail.com>
@evankanderson
Copy link
Contributor Author

The python program I wrote:

https://github.com/evankanderson/docs/tree/message-dumper/eventing/samples/message-dumper

(No readme or the like right now, and still some debugging/commented information from diagnosing this issue.)

@denismakogon
Copy link
Member

denismakogon commented Jan 12, 2019

@evankanderson can you please merge this PR with #7? I'd like to get them into altogether.

@evankanderson
Copy link
Contributor Author

evankanderson commented Jan 12, 2019 via email

@denismakogon
Copy link
Member

can you close this PR and merge commits from this branch to PR #7, please? I'd be happy to release a new version of an SDK early next week.

@evankanderson
Copy link
Contributor Author

Closed this in favor of #9. I can't merge commits to #7, because I don't have write access to cloudevents/sdk-python. Instead, I sent a PR to the branch that #7 is based off of, which will cause these changes to be present in #7 once that PR is merged.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants