Improve split() DSL (#8666)

* Introduce a `SplitterSpec` which can accept possible
splitter variants: `expression`, `function`, `ref` etc.
This way we are going to have a complex endpoint configuration
only with a single method argument.
* Use `SplitterSpec` in a newly introduced `splitWith()`
* Deprecate those `split()` methods which use `SplitterEndpointSpec`.
This method are complex enough because of their several arguments
* Refactor some common `MessageHandler` options initialization
into the `ConsumerEndpointSpec.doGet()`
* Disable failing now `MethodInvokingMessageProcessorTests.testCollectionArgument()`:
or Jackson problem, or fresh SF
* Groovy DSL will be fixed in the separate PR:
https://stackoverflow.com/questions/76595843/groovy-selects-a-defaultgroovymethods-split-instead-of-mine-one
This commit is contained in:
Artem Bilan
2023-07-03 10:35:21 -04:00
committed by GitHub
parent 0798c8df95
commit 34f901f7db
26 changed files with 607 additions and 124 deletions

View File

@@ -416,11 +416,12 @@ public class FileTests {
.addFilter(new AcceptOnceFileListFilter<>())
.addFilter(fileExpressionFileListFilter)),
e -> e.poller(p -> p.fixedDelay(100)))
.split(Files.splitter()
.splitWith(s -> s
.id("fileSplitter")
.ref(Files.splitter()
.markers()
.charset(StandardCharsets.US_ASCII)
.applySequence(true),
e -> e.id("fileSplitter"))
.applySequence(true)))
.channel(c -> c.queue("fileSplittingResultChannel"))
.get();
}