Fix Groovy DSL for new splitter style (#8669)

* Fix Groovy DSL for new splitter style

* Introduce a new `GroovyIntegrationFlowDefinition.splitWith()`
to avoid clashing with existing method
* Deprecate all other `split()` variants, but left one without arguments
for a default splitting options
* Fix doc for new splitter style

* * Fix tab indentations in `groovy-dsl.adoc`
This commit is contained in:
Artem Bilan
2023-07-10 11:08:44 -04:00
committed by GitHub
parent 34f901f7db
commit 72fc79dbd5
5 changed files with 83 additions and 11 deletions

View File

@@ -89,8 +89,15 @@ functionFlow() {
transformer { it.toUpperCase() }
expectedType String
}
split Message<?>, { it.payload }
split Object, { it }, { id 'splitterEndpoint' }
splitWith {
expectedType Message<?>
function { it.payload }
}
splitWith {
expectedType Object
id 'splitterEndpoint'
function { it }
}
resequence()
aggregate {
id 'aggregator'

View File

@@ -97,7 +97,10 @@ fun someFlow() =
@Bean
someFlow() {
integrationFlow {
split Message<?>, { it.payload }
splitWith {
expectedType Message<?>
function { it.payload }
}
}
}
----

View File

@@ -229,8 +229,12 @@ fun unzipFlow(executor: Executor) =
unzipFlow(Executor executor) {
integrationFlow 'unzipChannel',
{
transform new UnZipTransformer()
split new UnZipResultSplitter()
transformWith {
ref new UnZipTransformer()
}
splitWith {
ref new UnZipResultSplitter()
}
channel { executor 'entriesChannel', executor }
}
}