-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Document Kotlin DSL #3210
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
Conversation
|
||
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. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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
FunctionsTests.kt