Skip to content
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

Hide toReactivePublisher() from lambdas #3065

Merged

Conversation

artembilan
Copy link
Member

When an IntegrationFlow is declared via lambda, it is impossible
to materialize it as a Publisher since we lose a Lambda context and
finish with a NoSuchBeanException when we would like to inject that
Publisher

  • Make IntegrationFlowDefinition.toReactivePublisher() as protected
    and expose it on the IntegrationFlowBuilder level
  • Use Channels as a singleton: no reason in overhead for its instances
  • Some code style polishing for IntegrationFlowDefinition

When an `IntegrationFlow` is declared via lambda, it is impossible
to materialize it as a `Publisher` since we lose a Lambda context and
finish with a `NoSuchBeanException` when we would like to inject that
`Publisher`

* Make `IntegrationFlowDefinition.toReactivePublisher()` as `protected`
and expose it on the `IntegrationFlowBuilder` level
* Use `Channels` as a singleton: no reason in overhead for its instances
* Some code style polishing for `IntegrationFlowDefinition`
Copy link
Contributor

@garyrussell garyrussell left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One minor issue.

@@ -129,8 +131,7 @@ public FluxMessageChannelSpec flux(String id) {
return MessageChannels.flux(id);
}

Channels() {
super();
private Channels() {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Best to leave super() to avoid empty block complaint from Sonar.

@garyrussell garyrussell merged commit c4aceb6 into spring-projects:master Sep 26, 2019
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.

None yet

2 participants