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

Document Kotlin DSL #3210

Merged
merged 2 commits into from
Mar 10, 2020
Merged

Conversation

artembilan
Copy link
Member

  • Remove unused imports in FunctionsTests.kt

@artembilan artembilan modified the milestones: 5.3.x, 5.3.M3 Mar 5, 2020

The Kotlin DSL is a wrapper and extension to <<./dsl.adoc#java-dsl,Java DSL>> and aimed to make Spring Integration development on Kotlin as smooth and straightforward as is it possible with interoperability with existing Java API and Kotlin language-specific structures.

All you need to get started is just an import for `org.springframework.integration.dsl.integrationFlow` - an overloaded global function for Kotlin DSL.
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
All you need to get started is just an import for `org.springframework.integration.dsl.integrationFlow` - an overloaded global function for Kotlin DSL.
All you need to get started is just an import for `org.springframework.integration.dsl.kotlin.integrationFlow` - an overloaded global function for Kotlin DSL.

[[kotlin-dsl]]
== Kotlin DSL

The Kotlin DSL is a wrapper and extension to <<./dsl.adoc#java-dsl,Java DSL>> and aimed to make Spring Integration development on Kotlin as smooth and straightforward as is it possible with interoperability with existing Java API and Kotlin language-specific structures.
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
The Kotlin DSL is a wrapper and extension to <<./dsl.adoc#java-dsl,Java DSL>> and aimed to make Spring Integration development on Kotlin as smooth and straightforward as is it possible with interoperability with existing Java API and Kotlin language-specific structures.
The Kotlin DSL is a wrapper and extension to <<./dsl.adoc#java-dsl,Java DSL>> and aimed to make Spring Integration development on Kotlin as smooth and straightforward as possible with interoperability with the existing Java API and Kotlin language-specific structures.
``` @

See more overloaded `integrationFlow()` variants below.

Many other scenarios require an `IntegrationFlow` to be started from source of data (e.g. `JdbcPollingChannelAdapter`, `JmsInboundGateway` or just an existing `MessageChannel`).
For this purpose Spring Integration Java DSL provides an `IntegrationFlows` factory with its bunch of overloaded `from()` methods.
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
For this purpose Spring Integration Java DSL provides an `IntegrationFlows` factory with its bunch of overloaded `from()` methods.
For this purpose, the Spring Integration Java DSL provides an `IntegrationFlows` factory with its large number of overloaded `from()` methods.

====

But unfortunately not all `from()` methods are compatible with Kotlin structures.
To fix a gap, this project provides a Kotlin DSL around an `IntegrationFlows` factory.
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
To fix a gap, this project provides a Kotlin DSL around an `IntegrationFlows` factory.
To fix the gap, this project provides a Kotlin DSL around an `IntegrationFlows` factory.


But unfortunately not all `from()` methods are compatible with Kotlin structures.
To fix a gap, this project provides a Kotlin DSL around an `IntegrationFlows` factory.
It is done as a set of overloaded `integrationFlow()` functions.
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
It is done as a set of overloaded `integrationFlow()` functions.
It is implemented as a set of overloaded `integrationFlow()` functions.

But unfortunately not all `from()` methods are compatible with Kotlin structures.
To fix a gap, this project provides a Kotlin DSL around an `IntegrationFlows` factory.
It is done as a set of overloaded `integrationFlow()` functions.
With a consumer for a `KotlinIntegrationFlowDefinition` to declare the rest of the flow as an `IntegrationFlow` lambda to reuse the mentioned above experience and also avoid `get()` call in the end.
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
With a consumer for a `KotlinIntegrationFlowDefinition` to declare the rest of the flow as an `IntegrationFlow` lambda to reuse the mentioned above experience and also avoid `get()` call in the end.
With a consumer for a `KotlinIntegrationFlowDefinition`, to declare the rest of the flow as an `IntegrationFlow` lambda to reuse the mentioned above experience; unlike the Java DSL, it also avoids the need for a `get()` call at the end of the flow.

----
====

In addition Kotlin extensions are provided for Java DSL API which needs some refinement for Kotlin structures.
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
In addition Kotlin extensions are provided for Java DSL API which needs some refinement for Kotlin structures.
In addition, Kotlin extensions are provided for the Java DSL API which needs some refinement for Kotlin structures.

* Remove unused imports in `FunctionsTests.kt`
@garyrussell garyrussell merged commit 36f96ec into spring-projects:master Mar 10, 2020
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