SortPage edited by Aaron MulderChanges (7)
Full ContentSortAvailable as of Camel 2.0 Sort can be used to sort a message. Imagine you consume text files and before processing each file you want to be sure the content is sorted. Sort will by default sort the body using a default comparator that handles numeric values or uses the string representation. You can provide your own comparator, and even an _expression_ to return the value to be sorted. Sort requires the value returned from the _expression_ evaluation is convertible to java.util.List as this is required by the JDK sort operation. Using from Java DSLIn the route below it will read the file content and tokenize by line breaks so each line can be sorted.
from("file://inbox").sort(body().tokenize("\n")).to("bean:MyServiceBean.processLine");
Change Notification Preferences
View Online
|
View Changes
|
Add Comment
|
- [CONF] Apache Camel > Sort confluence
- [CONF] Apache Camel > Sort confluence
- [CONF] Apache Camel > Sort confluence