So maybe I'm missing something obvious, which is very possible!
However, I want to migrate a route from Spring to Java. This route is something like:
<bean id="myFilter" class="my.filter.MyFilter />
<route>
<from uri="ftp://someplace?filter=#myFilter" />
<to uri=(....) />
</route>
When converting to Java DSL I thought the following would be equivalent, but it's not. I get different behavior than I thought I would:
MyFilter m = new MyFilter();
.........
from("ftp://someplace")
.filter().method(m)
.to(....)
;
The way above seems to retrieve the files from the FTP server and then filter, one by one.
Whereas the Spring way, with the filter option in the URI, seems to filter out all the results I don't want first, then continue on its merry little way.
Is there a way to recreate the functionality of the filter as part of the URI in Java DSL?
I'm assuming I'd have to declare a bean in some fashion in order to be able to use it, but the documentation I'm finding doesn't seem to be clear on how I can achieve this.