Examples
-
Example 1 : Simple splitter
-
Example 2 : Splitter with subsequent aggregation
-
Example 3 : Splitter with subsequent aggregation using POJO bean instead of AggregationStrategy implementation
-
Example 4 : Splitter with subsequent aggregation failing on exception
-
Example 5 : Splitter with subsequent aggregation on failing on aggregation exception
run the application
mvn spring-boot:run
split from string
curl -X POST http://localhost:8080/api/split-on-log -H "Content-Type: text/plain" --data "A,B,C"
convert to array and then split
curl -X POST http://localhost:8080/api/split-on-log -H "Content-Type: text/plain" --data "A,B,C" --header "convert-to: array"
in both above request you will se the data split by comma (,), so "A,B,C" will be logged each character on one new line
the message is split, transformed and aggregated
curl -X POST http://localhost:8080/api/split-aggregate-on-log -H "Content-Type: text/plain" --data "A,B,C"
the route will stop at first error, the split messages after the error will not be processed
curl -X POST http://localhost:8080/api/handle-error -H "Content-Type: text/plain" --data "A,E,C"
If you hit any problem using Camel or have some feedback, then please let us know.
We also love contributors, so get involved :-)
The Camel riders!