Camel Route - File name

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Camel Route - File name

KhajaNawas14
Hi All,

currently my query is like any file that comes to this folder will be processed to next stage. However I would like to add the file name also my camel route so that i can re-use the same folder for multiple files.

sample folder cd-erpdata-csv
sample file name us-ddmmyy.csv and uk-ddmmyy.csv

<camel:from uri="file:messaging/cd-erpdata-csv?preMove=inprogress&amp;move=.done"/>


Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Camel Route - File name

KhajaNawas14
Note:- I am a beginner to camel route.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

RE: Camel Route - File name

siano
Hi,

see http://camel.apache.org/file2.html 

you should especially have a look into the fileName option which will likely do what you want.

Best regards
Stephan

-----Original Message-----
From: KhajaNawas14 [mailto:[hidden email]]
Sent: Dienstag, 18. April 2017 06:14
To: [hidden email]
Subject: Re: Camel Route - File name

Note:- I am a beginner to camel route.



--
View this message in context: http://camel.465427.n5.nabble.com/Camel-Route-File-name-tp5797776p5797777.html
Sent from the Camel - Users mailing list archive at Nabble.com.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

RE: Camel Route - File name

KhajaNawas14
Thanks, I tried to do it based on the suggested link however I am encountering the below issue

Tried with the below
${file:name.noext}.org?

Error

Dynamic expressions with ${ } placeholders is not allowed. Use the fileName option to set the dynamic expression.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Camel Route - File name

Claus Ibsen-2
In reply to this post by KhajaNawas14
You need to use a fileFilter to dynamic chose which files to consume.
There is more details on that file component doc page

On Tue, Apr 18, 2017 at 6:11 AM, KhajaNawas14 <[hidden email]> wrote:

> Hi All,
>
> currently my query is like any file that comes to this folder will be
> processed to next stage. However I would like to add the file name also my
> camel route so that i can re-use the same folder for multiple files.
>
> sample folder cd-erpdata-csv
> sample file name us-ddmmyy.csv and uk-ddmmyy.csv
>
> <camel:from
> uri="file:messaging/cd-erpdata-csv?preMove=inprogress&amp;move=.done"/>
>
>
>
>
>
>
> --
> View this message in context: http://camel.465427.n5.nabble.com/Camel-Route-File-name-tp5797776.html
> Sent from the Camel - Users mailing list archive at Nabble.com.



--
Claus Ibsen
-----------------
http://davsclaus.com @davsclaus
Camel in Action 2: https://www.manning.com/ibsen2
Loading...