-
1. Re: Unable to get moveFailed to work for File2 component
davsclaus Apr 24, 2012 3:25 AM (in response to mohithanda)There is a missing $ in the . When you use those { } tokens, then the first should always be ${ and the closing a }.
-
2. Re: Unable to get moveFailed to work for File2 component
mohithanda Apr 24, 2012 3:47 AM (in response to davsclaus)Thanks Claus for the prompt response.
Now my endpoint looks like the following
file:C:
temp
csv?move=done&moveFailed=error
$-$.$I also tried
file:C:
temp
csv?move=done&moveFailed=error/$-$.$Just tried that and I get the following error
My input filename is test_with_headers-error.csv
Do I have to set something in the exchange message header?
Regards,
Mohit
-
3. Re: Unable to get moveFailed to work for File2 component
davsclaus Apr 24, 2012 8:04 AM (in response to mohithanda)What version of Camel are you using?
And if you use XML, then make sure to use & as the &, because with XML you must escape the & chars.
-
4. Re: Unable to get moveFailed to work for File2 component
mohithanda Apr 24, 2012 8:27 PM (in response to davsclaus)I am using camel 2.6.0
I am also using DSL to define my routes. Although I am injecting the file endpoint using spring config into my RouteBuilder class. And the spring config uses PropertyPlaceHolder and reads a .properties file to lookup the endpoint definition.
.properties file
test.source.file.or.directory=file:C:
temp
csv?move=done&moveFailed=error
$-$.$Spring config snippet
Edited by: mohithanda on Apr 25, 2012 12:24 AM
-
5. Re: Unable to get moveFailed to work for File2 component
davsclaus Apr 25, 2012 1:03 AM (in response to mohithanda)Can you try a newer version of Camel. There used to be a bug in an older release about the ${ } not working on the file component.
-
6. Re: Unable to get moveFailed to work for File2 component
mohithanda Apr 25, 2012 7:49 PM (in response to davsclaus)Ok. I can try that.
In the meantime, I printed out the source endpoint in my route builder and I see the following
file:C:\temp\csv?move=done&moveFailed=error\name.noext-now:yyyyMMddHHmmssSSS.ext
Seems like something is stripping out all the placeholders in the endpoint definition. As in, ${} doesn't get printed. Not sure if this is the expected behaviour or not.
from(getSource())
.process(new Processor() {
@Override
public void process(Exchange exchng) throws Exception {
LOGGER.debug(":" + getSource() + ":");
}
})
And I see
:file:C:\temp\csv?move=done&moveFailed=error\name.noext-now:yyyyMMddHHmmssSSS.ext:
Edited by: mohithanda on Apr 25, 2012 11:48 PM
-
7. Re: Unable to get moveFailed to work for File2 component
davsclaus Apr 26, 2012 4:05 AM (in response to mohithanda)How do you use and run your application? Do you use Spring? And if so do you use spring property placeholders or some sort?
Yes the ${ } should be preserved, but Camel will normalize the uri, so some tokens gets printed as %2F etc using an encoded value.