Out of curiosity, have you tried using the existing sortBy element in the file binding config? I can prepare an example, but figured I would ask in case you already tried that and hit an issue.
No I haven't tried the sortBy in fhe file binding config. In fact I don't know what the file binding config is! I'll google it and I hope I find something. I'll let you know.
Each binding type in SwitchYard has a schema which defines the structure of its configuration model. For file bindings, you can see the options here:
The value range and behavior of these settings are identical to the Camel file component since we just create a Camel endpoint URI underneath the covers based on the binding config:
Using one of our quickstarts which uses file binding as an example:
I would expect something like this to work:
<file:binding.file xmlns:file="urn:switchyard-component-camel-file:config:1.0"> <file:directory>target/input</file:directory> <file:fileName>test.txt</file:fileName> <file:consume> <file:initialDelay>10</file:initialDelay> <file:delay>10</file:delay> <file:delete>true</file:delete> <file:sortBy>file:modified</file:sortBy> </file:consume> </file:binding.file>
Thats exactly what I wanted. I looked at my switchyard.xml and found the file binding but I hadn't actually added the sortBy before I read your email. Added it and everything seems to work as expected. Thanks