-
Notifications
You must be signed in to change notification settings - Fork 167
Spring Boot Web and Webflux Helpers/Binding for CloudEvents #201
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
Conversation
|
@spencergibb @cmoulliard @olegz @slinkydeveloper I am happy to accept feedback to make this better.. |
Signed-off-by: salaboy <salaboy@gmail.com>
Signed-off-by: salaboy <salaboy@gmail.com>
|
Hi @salaboy! Thanks for looking at this! I wonder, can you use the message reader/writer APIs like in https://github.com/cloudevents/sdk-java/tree/master/http? I can guide you through, look at the vertx or restful ws module implementations and they should give you an idea of how it looks like |
slinkydeveloper
left a comment
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.
Can you remove the .DS_Store file and the LICENSEs (we don't need them because they're already in the root of the project)
|
@slinkydeveloper sure I can.. sorry about the .DS_Store files.. I am adding them to .gitignore now. Also @slinkydeveloper you mean doing something like: For spring boot? |
Signed-off-by: salaboy <salaboy@gmail.com>
|
@salaboy exactly. You need to think at these |
Signed-off-by: salaboy <salaboy@gmail.com>
|
|
||
| ```java | ||
| @PostMapping | ||
| public String recieveCloudEvent(@RequestHeader Map<String, String> headers, @RequestBody Object body) { |
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.
Typo: recieve -> receive 😄
| public String recieveCloudEvent(@RequestHeader Map<String, String> headers, @RequestBody Object body) { | |
| public String receiveCloudEvent(@RequestHeader Map<String, String> headers, @RequestBody Object body) { |
| ```xml | ||
| <dependency> | ||
| <groupId>io.cloudevents</groupId> | ||
| <artifactId>spring-boot-starter-web-cloudevents</artifactId> |
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.
Who is gonna to release/maintain such a starter like also the WebFlux one ? @salaboy
|
|
||
| ```java | ||
| // Create the CloudEvent with the builder | ||
| final CloudEvent myCloudEvent = CloudEventBuilder.v03() |
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.
Hiding the version of the spec or the version of the builder (v03, V1, ....) is perhaps not a great idea. I would prefer that this version is part of the GAV consumed by the starter to make it available publicly to all the users.
|
@slinkydeveloper I will be happy to check if the new PR is covering what I needed to do from my side.. |
|
@slinkydeveloper I will close this PR because this was solved already! I am super happy with the results! :) |
Here are some helpers for Spring Boot (web and webflux) to parse and send Cloud Events from Spring Boot applications.
This is based on this blog post which contains some examples (examples in the blog post needs to be updated to use the new version of the helpers provided in this PR)
https://salaboy.com/2020/02/20/getting-started-with-knative-2020/