Details
-
Improvement
-
Status: Resolved
-
Minor
-
Resolution: Fixed
-
None
-
None
-
Unknown
Description
Assuming we have the following route in Java:
from("direct:a") .split().tokenize("\n")) .log("${body}");
This route will log each individual item produced as a result of splitting the incoming message with the given token and to implement the same in YAML, you need something like:
- from: uri: "direct:a" steps - split: tokenize: \n" steps: - log: "${body}"
Which is fine but a a little bit verbose and convoluted if compared to the Java counterpart.
We could improve the dsl by introducing an option to enable chaining processors based on if they support outputs or not so the same route can be rewritten in YAML like:
- from: uri: "direct:a" steps: - split: tokenize: \n" - log: "${body}"
In this case, as the split processor does not have any defined step, we can wire the log processor to split's output.
Attachments
Issue Links
- links to