-
Notifications
You must be signed in to change notification settings - Fork 160
Spring integration #142
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
Comments
Ping @bsideup |
cc @olegz (Spring Cloud) |
I guess there should be clarification on what type of integration you are looking for. Spring provides variety of ways to expose user functionality as REST endpoints. Some of them require user to no configuration at all. I can certainly elaborate further but it would help if more specifics are shared |
The Jax-Rs integration will consists of a |
There are many equivalents to |
Anyone who used JAX-RS with Spring I imagine could register the |
I've merged the jax-rs integration https://github.com/cloudevents/sdk-java/tree/master/http/restful-ws Let me know if this is enough to work OOTB with Spring or if we need something else 😄 . If we want to leverage some features specific to Spring, we can definitely have a module like |
@slinkydeveloper when you're saying "work OOTB with Spring" - do you mean that this is enough to call it "Spring support", or that, when Spring's JAX-RS integration is used, the module works? edit: @slinkydeveloper's comment was edited and mine makes little sense now, but I will keep it here for clarity, because there seem to be some misconception |
Ah ok, please forget my ignorance about that 😄 |
For Spring, then we should add a new module within this SDK implementing |
@cmoulliard are you willing to give a try to it? 😄 |
@slinkydeveloper I would highly recommend to contact the Spring team before proceeding, to ensure that what you're doing here is aligned with what will be the official CloudEvents support in Spring. |
Where such official CloudEvents vision is defined and communicated for the spring users/developers ? @bsideup |
@cmoulliard at the moment it is not very clear as to what does Spring support even mean, since Spring portfolio consists of many projects. As for communication . . as an example, we have request in spring-cloud-function to add Cloud Events support which most likely be a simply translation layer between Spring Message and CloudEvent, since their structures are pretty much identical. Basically IMHO I don't think the terminology such as "CloudEvents support in Spring" or "Spring Integration" - (which is also the name of one of Spring's frameworks) is appropriate or meaningful without further clarifying which specific part of Spring one is referring to. |
I used the word |
Is there any reason why we can't have this integration inside this community project (similar to how we've done for kafka, jax-rs and vertx)? It sounds a pretty lightweight integration that can live under some |
@cmoulliard i was referring to the "quoted text" - |
@cmoulliard @slinkydeveloper I've just created a PR with some Spring Boot (Web and WebFlux) Helpers -> #201 |
As it was suggested by Dave earlier, there are many types of abstractions in spring representing different types of readers and writers specific to the context of current execution etc. And then of course there are many projects where CloudEvents may be relevant, so I am not sure how feasible it is to manage all of them in isolation from where they are most relevant to be used. |
@olegz that makes a lot of sense to me .. I've provide a simple helper to get people started.. we can change the implementation to use Spring Message underneath later. I want to make sure that we unblock spring users to start using Cloud Events asap.. Do you think that is worth using Spring Message even for these simple helpers? |
@salaboy I understand what you're trying to do and unfortunately I don't have a clear answer at the moment. That is perhaps the reason for Dave's earlier comment about simply "ensuring stable API":
May be it is better to to let individual spring projects to handle it. As I mentioned before we have an open issue in spring-cloud-function which most likely will result in the implementation of the MessageConverter and then the question would be to push/migrate such implementation up to Spring Messaging so every projects can benefit from it automatically without user doing anything at all. |
Such |
Looking at PR #201, this is not an idiomatic way to integrate. I would suggest implementing an @PostMapping
public String recieveCloudEvent(CloudEvent cloudEvent) {
// ...
} Or: CloudEvent cloudEvent = ...
restTemplate.postForEntity(url, cloudEvent, String.class) For WebFlux, it would be a pair of CloudEvent cloudEvent = ...
webClient.post().uri(url).bodyValue(cloudEvent).retrieve() |
@cmoulliard |
Given the ongoing work on jaxrs implementation, what it takes to integrate with spring?
The text was updated successfully, but these errors were encountered: