Skip to content

Commit

Permalink
GH-3800: Fix Kotlin docs for route() DSL
Browse files Browse the repository at this point in the history
Fixes #3800

* Mention `Message` as a type for reified generic argument in Kotlin DSL docs

**Cherry-pick to `5.5.x`**
  • Loading branch information
artembilan committed May 17, 2022
1 parent 5a92d1f commit 627a797
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -145,15 +145,15 @@ class KotlinIntegrationFlowDefinition(@PublishedApi internal val delegate: Integ


/**
* Inline function for [IntegrationFlowDefinition.filter] providing a `filter<MyTypeIn>()` variant
* Inline function for [IntegrationFlowDefinition.route] providing a `route<MyTypeIn>()` variant
* with reified generic type.
*/
inline fun <reified P> route(crossinline function: (P) -> Any?) {
route(function) { }
}

/**
* Inline function for [IntegrationFlowDefinition.filter] providing a `filter<MyTypeIn>()` variant
* Inline function for [IntegrationFlowDefinition.route] providing a `route<MyTypeIn>()` variant
* with reified generic type.
*/
inline fun <reified P, T> route(
Expand Down
1 change: 1 addition & 0 deletions src/reference/asciidoc/kotlin-dsl.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -93,4 +93,5 @@ fun convertFlow() =
----
====

NOTE: The reified type can be a whole `Message<*>` if there need access to headers as well in the lambda of the operator.

0 comments on commit 627a797

Please sign in to comment.