You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by Jey350 <je...@hotmail.com> on 2014/03/12 16:59:57 UTC

doneFileName with dynamic filename

Hello,

I'm using Camel 2.10 and I have the following problem:

I need to make a XML route which use doneFileName with "dynamic filename".
To be more precise, in a folder I have:
ACKXXX-filename1 (doneFile)
filename1 (file to process)
ACKYYY-filename2 (doneFile)
filename2 (file to process)

Since "XXX" and "YYY" are not the same (but same string length) I can't use
simply the doneFileName.
I can't create multiple routes because I don't know what XXX and YYY will be
and I can't change the doneFile format.
Is there a workaround to solve my problem ? Like wildcard (ex:
doneFileName=ACK???-${file:name}) or other solution ?

Thanks.




--
View this message in context: http://camel.465427.n5.nabble.com/doneFileName-with-dynamic-filename-tp5748706.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: doneFileName with dynamic filename

Posted by Jey350 <je...@hotmail.com>.
Hi,

Thank you for your fast anwers and the time you spent on my case.

I'll probably stay with the "readLockCheckInterval" and ignore the done
files.

Rgds.





--
View this message in context: http://camel.465427.n5.nabble.com/doneFileName-with-dynamic-filename-tp5748706p5748779.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: doneFileName with dynamic filename

Posted by Claus Ibsen <cl...@gmail.com>.
Hi

Ah yeah had a 2nd look, the doneFileName only supports

        // we only support ${file:name} or ${file:name.noext} as
dynamic placeholders for done files



On Thu, Mar 13, 2014 at 2:50 PM, Jey350 <je...@hotmail.com> wrote:
> Hi,
>
> It seems impossible in camel 2.10.1 to put a complex expression excluding
> ${file:} or ${date:}.
> I get the error :
> org.apache.camel.ExpressionIllegalSyntaxException: Illegal syntax: C:\myFile
> Cannot resolve reminder: ${bean:myBean?method=doSomething}
>
> Event a simplier expression like ${properties:myProperty} throws the same
> exception.
>
> Thanks.
>
>
>
>
>
>
> --
> View this message in context: http://camel.465427.n5.nabble.com/doneFileName-with-dynamic-filename-tp5748706p5748771.html
> Sent from the Camel - Users mailing list archive at Nabble.com.



-- 
Claus Ibsen
-----------------
Red Hat, Inc.
Email: cibsen@redhat.com
Twitter: davsclaus
Blog: http://davsclaus.com
Author of Camel in Action: http://www.manning.com/ibsen
Make your Camel applications look hawt, try: http://hawt.io

Re: doneFileName with dynamic filename

Posted by Jey350 <je...@hotmail.com>.
Hi,

It seems impossible in camel 2.10.1 to put a complex expression excluding
${file:} or ${date:}.
I get the error : 
org.apache.camel.ExpressionIllegalSyntaxException: Illegal syntax: C:\myFile
Cannot resolve reminder: ${bean:myBean?method=doSomething}

Event a simplier expression like ${properties:myProperty} throws the same
exception.

Thanks.






--
View this message in context: http://camel.465427.n5.nabble.com/doneFileName-with-dynamic-filename-tp5748706p5748771.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: doneFileName with dynamic filename

Posted by Claus Ibsen <cl...@gmail.com>.
Hi

You can use ${bean:xxx} in the syntax to call a bean that computes the
done name.

On Thu, Mar 13, 2014 at 9:16 AM, Jey350 <je...@hotmail.com> wrote:
> Hi Claus,
>
> Thank you for your support.
> I indeed read the f..ollowing manual  http://camel.apache.org/file2
> <http://camel.apache.org/file2>   but it doesn't solve my problem.
>
> It would have worked well if my doneFile looked like ACK${file:name} but
> it's ACKXXX-${file:name} and ACKYYY-${file:name} in one route, so i'm stuck.
>
> Thanks.
>
>
>
> --
> View this message in context: http://camel.465427.n5.nabble.com/doneFileName-with-dynamic-filename-tp5748706p5748733.html
> Sent from the Camel - Users mailing list archive at Nabble.com.



-- 
Claus Ibsen
-----------------
Red Hat, Inc.
Email: cibsen@redhat.com
Twitter: davsclaus
Blog: http://davsclaus.com
Author of Camel in Action: http://www.manning.com/ibsen
Make your Camel applications look hawt, try: http://hawt.io

Re: doneFileName with dynamic filename

Posted by Jey350 <je...@hotmail.com>.
Hi Claus,

Thank you for your support.
I indeed read the f..ollowing manual  http://camel.apache.org/file2
<http://camel.apache.org/file2>   but it doesn't solve my problem.

It would have worked well if my doneFile looked like ACK${file:name} but
it's ACKXXX-${file:name} and ACKYYY-${file:name} in one route, so i'm stuck.

Thanks.



--
View this message in context: http://camel.465427.n5.nabble.com/doneFileName-with-dynamic-filename-tp5748706p5748733.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: doneFileName with dynamic filename

Posted by Claus Ibsen <cl...@gmail.com>.
Hi

Have you read the docs at
http://camel.apache.org/file2

There is some examples with dynamic done file names.

On Wed, Mar 12, 2014 at 4:59 PM, Jey350 <je...@hotmail.com> wrote:
> Hello,
>
> I'm using Camel 2.10 and I have the following problem:
>
> I need to make a XML route which use doneFileName with "dynamic filename".
> To be more precise, in a folder I have:
> ACKXXX-filename1 (doneFile)
> filename1 (file to process)
> ACKYYY-filename2 (doneFile)
> filename2 (file to process)
>
> Since "XXX" and "YYY" are not the same (but same string length) I can't use
> simply the doneFileName.
> I can't create multiple routes because I don't know what XXX and YYY will be
> and I can't change the doneFile format.
> Is there a workaround to solve my problem ? Like wildcard (ex:
> doneFileName=ACK???-${file:name}) or other solution ?
>
> Thanks.
>
>
>
>
> --
> View this message in context: http://camel.465427.n5.nabble.com/doneFileName-with-dynamic-filename-tp5748706.html
> Sent from the Camel - Users mailing list archive at Nabble.com.



-- 
Claus Ibsen
-----------------
Red Hat, Inc.
Email: cibsen@redhat.com
Twitter: davsclaus
Blog: http://davsclaus.com
Author of Camel in Action: http://www.manning.com/ibsen
Make your Camel applications look hawt, try: http://hawt.io