Skip to content

Add Java DSL .fluxTransform(Function) operator #2541

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

Merged
merged 2 commits into from
Aug 20, 2018

Conversation

artembilan
Copy link
Member

@artembilan artembilan commented Aug 17, 2018

For better interoperability with Reactor Flux from the
end-user perspective introduce an operator which could
call a target Function with integration data wrapped to the Flux
and expect a Publisher<?> result to continue the flow.
This way end-user just needs to implement a Function (or method)
to accept the Flux as an input and return some Publisher
after the sequence of reactive operators.

Such a new operator also allows a smooth integration with the
Spring Cloud Function, where it is just enough to lookup the function
in the catalog and inject it into this operator

@artembilan
Copy link
Member Author

@olegz ,

This is what we talked about how to avoid extra call for the source.output() when we mix Spring Integration Java DSL and Spring Cloud Function.
Also pay attention how I use Mono.subscriberContext() to propagate a requestMessage to be used for building reply message.

Let me know WDYT!

Thank you

/CC @smaldini

@garyrussell
Copy link
Contributor

Please update the commit comment with rationale.

For better interoperability with Reactor `Flux` from the
end-user perspective introduce an operator which could
call a target `Function` with integration data wrapped to the `Flux`
and expect a `Publisher<?>` result to continue the flow.
This way end-user just needs to implement a `Function` (or method)
to accept the `Flux` as an input and return some `Publisher`
after the sequence of reactive operators.

Such a new operator also allows a smooth integration with the
Spring Cloud Function, where it is just enough to lookup the function
in the catalog and inject it into this operator
@artembilan
Copy link
Member Author

Pushed.
Thank you for the pointer!

@artembilan
Copy link
Member Author

Do not merge yet: I'm going to move the body of that fluxTransform() to the separate class.
Too much noise in so huge already IntegrationFlowDefinition...

@garyrussell garyrussell merged commit f9fe709 into spring-projects:master Aug 20, 2018
@olegz
Copy link
Contributor

olegz commented Aug 20, 2018

FWIW, I know Gary already merged it, but as Artem said this came up as he was reviewing one of the PRs for SCSt/SCF integration work, so I can definitely use it now.

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.

3 participants