spring-projects / spring-integration-samples

You are looking for examples, code snippets, sample applications for Spring Integration? This is the place.

Home Page:http://www.springsource.org/spring-integration

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Add examples for using SI with Project Reactor

apffa opened this issue · comments

commented

I'd like there to be examples for using the JavaDSL with Project Reactor. It's very hard to find reference to such usage. In general, this repo is super confusing and hard for JavaDSL users.

Yes, we know that this repo has to have more love for Java DSL samples.
Unfortunately we don't have enough resources to support everything around in a smooth manner.

Regarding the Project Reactor support.

There is no simple and straightforward answer. The target solution depends on your use-case.
For example you may just want to use Spring WebFlux in your integration flow. So, you go to the spring-integration-weblux module and take into account its WebFlux factory.
You may just deal with a @MessagingGateway which provides a support for a Mono result - on-demand execution of the flow for data you send to this gateway.
You may want reply with a reactive type from your service activator method.
You may want to store into DB using R2DBC driver.
To start the flow from some existing Publsiher; adapt the flow to the Publisher back.
In the end you may want build the whole reactive flow connecting endpoints via FluxMessageChannel.

My point is that even if we would provide some explicit reactive streams example it would not answer to all the possible reactive questions with integration.
in fact it is better to think about some specific use-case which could be solved with reactive streams and Spring Integration.
So, perhaps if you share more of your requirements, we may be able to come up with some simple example to demonstrate.

The basics of Spring Integration are present in this repo.
The basics of Project Reactor in their repo.
How to connect and communicate between them is there in the doc: https://docs.spring.io/spring-integration/docs/current/reference/html/reactive-streams.html#reactive-streams.

The concrete complex use-case is out of scope of these projects.

You may find some my answers to reactive streams questions in my sandbox repo: https://github.com/artembilan/sandbox

@artembilan I think you should upload your sandbox examples into this repo. Reactive Spring Integration with Kafka? Super relevant. Why hide it? Of course the request for "more Reactive Spring Integration examples" is general, but he's right in general. If there would be more examples there it would be much easier for people. And it doesn't really matter what kind of examples. Any JavaDSL & Reactive based examples would help people. The more organized and large the project would be, the more helpful.

@artembilan Data pipelines like you have in your own repo are exactly the ones people ask.

Sure!
You know I won't mind if you try to transfer that my sandbox over here as PRs. 😄