-
1. Re: can't get "enrich" to work
davsclaus Sep 24, 2010 12:34 AM (in response to julianc)Yeah as the exception says you can use pollEnrich with files when the from was file based as well. This has just recently been implement in the next Camel 2.5 release.
Instead of doing like that you can instead just use a custom filter on the file endpoint. And then check if there is a .mrk file for the given file.
You just implement a GenericFiler and then check if the .mrk file exists and return either true or false. Much easier.
-
2. Re: can't get "enrich" to work
julianc Sep 24, 2010 6:44 PM (in response to davsclaus)Thanks, that sounds like a plan.
I'll try enrich again in 2.5. (Not necessarily for this use case, but to understand).
Julian
-
3. Folder polling with ready file.
julianc Sep 26, 2010 12:31 PM (in response to julianc)OK, I tried the filter method and it works. I also tried the processStrategy idea and that works too, after a fashion.
I can't get the processed file moved in the strategy case - its like its ignoring the "super" calls (java attached).
But both seem supremely inefficient - my legacy code polls for "ready files" and only looks at the "real" files when there is a ready file. This is more like the "pollEnrich" method.
I'm thinking a better approach is to translate the ready file presence into a claim check and route this through to the grunt process which will do the ETL (ideally on aggregated sets of files).
-
4. Re: Folder polling with ready file.
davsclaus Sep 27, 2010 2:49 AM (in response to julianc)You can also do the reverse. Configure the file endpoint to only accept the .mrk files.
Then use a Processor to set the message body to the real file, and then add an on completion with logic to delete/move etc. the real file when the routing is done.
http://camel.apache.org/oncompletion.html
Exchange has API to add completion directly to it.
For example the Camel in Action book shows this in chapter 9, section 9.6
-
5. Re: Folder polling with ready file.
davsclaus Sep 27, 2010 2:56 AM (in response to julianc)I added a ticket to Apache to see if we could add support for marker files out of the box. Fell free to comment and feedback.
-
6. Re: Folder polling with ready file.
jessicaleahy Oct 5, 2010 10:25 PM (in response to julianc)I already tried the reverse. so far, it worked out great for me.
-
7. Re: Folder polling with ready file.
julianc Oct 15, 2010 10:25 PM (in response to davsclaus)That would be ideal. I've voted for it.
Thanks
Julian
-
8. Re: Folder polling with ready file.
julianc Oct 15, 2010 10:27 PM (in response to jessicaleahy)Cool - any chance you could post your solution? (on a steep learning curve here).
cheers
Julian