-
Notifications
You must be signed in to change notification settings - Fork 166
Restful WS Spring boot example #288
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
Restful WS Spring boot example #288
Conversation
|
Depends on #289 |
dsyer
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.
Some changes suggested inline.
...les/restful-ws-spring-boot/src/main/java/io/cloudevents/examples/springboot/Application.java
Outdated
Show resolved
Hide resolved
|
|
||
| @Configuration | ||
| public class JacksonConfiguration { | ||
| @Bean |
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.
You don't need this (Spring Boot provides it automatically).
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 I remove JerseyConfiguration too?
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.
I think you need to register the CloudEventsProvider?
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 CloudEventsProvider should be registered through the restful ws SPI: https://github.com/cloudevents/sdk-java/tree/master/http/restful-ws/src/main/resources/META-INF/services
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.
I see. Then I guess we still need it to register the MainResource at least? It's more common in a Spring Boot app to register the instance, not the class, but in this case it doesn't matter.
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.
TBH I'm not at all expert of conventions in Spring Boot, so I can't tell which solution is best 😄 ... Should I change the registration with the instances?
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.
I don't think it matters actually. This sample does it with class literals: https://github.com/spring-projects/spring-boot/blob/master/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-jersey/src/main/java/smoketest/jersey/JerseyConfig.java
|
@slinkydeveloper @dsyer this is good! and I think that is basically doing what I need as well. |
|
@dsyer that's cool.. I think that if webflux is supported I am more than ok with it.. I've created the @RestController stuff to create a PR to this repo, because I was aware that not everyone was into Webflux still. I am happy to see that supported in a much cleaner way.. I believe that this is a big enabler for people to use CE. |
Signed-off-by: Francesco Guardiani <francescoguard@gmail.com>
Signed-off-by: Francesco Guardiani <francescoguard@gmail.com>
Signed-off-by: Francesco Guardiani <francescoguard@gmail.com>
08e5d84 to
80f1a5e
Compare
Part of #125
Signed-off-by: Francesco Guardiani francescoguard@gmail.com