Document Kotlin DSL#3210
Merged
garyrussell merged 2 commits intospring-projects:masterfrom Mar 10, 2020
Merged
Conversation
garyrussell
suggested changes
Mar 10, 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. |
Contributor
There was a problem hiding this comment.
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. |
Contributor
There was a problem hiding this comment.
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. |
Contributor
There was a problem hiding this comment.
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. |
Contributor
There was a problem hiding this comment.
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. |
Contributor
There was a problem hiding this comment.
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. |
Contributor
There was a problem hiding this comment.
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. |
Contributor
There was a problem hiding this comment.
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`
f0759ef to
a4d070e
Compare
garyrussell
approved these changes
Mar 10, 2020
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
FunctionsTests.kt