You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by jtoepfer <jt...@brookdaleliving.com> on 2012/06/25 20:14:11 UTC

dynamic filename endpoint

I am using Apache Camel 2.7 with ActiveMQ 5.5.1.

I am trying to setup an endpoint filename with dynamic date, can someone
help.  I keep getting an error with the following...


<endpoint id="ftpEndpoint"

uri="ftp://abc@ftp.sample.com/OUT/Test?fileName=file-${date:now:yyyyMMdd}.xml"
/>

If I take off ${date:now:yyyyMMdd} the data gets sent to the file correctly.  
I'm looking for some direction, being very new to camel.

Thanks in advance.


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

Re: dynamic filename endpoint

Posted by jtoepfer <jt...@brookdaleliving.com>.
Claus,

   I just performed the test of using the uri of the <to/> and *it work*. 
So to clarify what I was doing and what does work.

So instead of using:

<endpoint id="ftpEndpoint"
uri="ftp://abc@ftp.sample.com/OUT/Test?fileName=file-${date:now:yyyyMMdd}.xml"
/>

<to uri="ftpEndpoint"/>

I changed it per your suggestion and it works.

<to
uri="ftp://abc@ftp.sample.com/OUT/Test?fileName=file-${date:now:yyyyMMdd}.xml"/>

Thanks for your help.

- Josh

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

Re: dynamic filename endpoint

Posted by jtoepfer <jt...@brookdaleliving.com>.
Claus,

   No not using spring property placeholders.  I'll try using the <to/> and
see how it goes.  Thanks for your help.

- Josh

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

Re: dynamic filename endpoint

Posted by Claus Ibsen <cl...@gmail.com>.
On Tue, Jun 26, 2012 at 2:11 PM, jtoepfer <jt...@brookdaleliving.com> wrote:
> Claus,
>
>   I was actually looking at the  http://camel.apache.org/file2.html File2
> reference of creating a filename.  I thought I should be able to do the same
> with FTP, is that not correct?
>
> This was the File Language example given:  mydata-${date:now:yyyyMMdd}.txt
>

Yes that is also supported by ftp as well.

There used to be a bug in older Camel release about setting that
expression. I would have assumed its fixed in 2.7 though.

Instead of using <endpoint> can you try using the uri directly in the <to>.

And are you sure you are not using Spring property placeholders?


> Thanks again for your help.
>
> --
> View this message in context: http://camel.465427.n5.nabble.com/dynamic-filename-endpoint-tp5715076p5715110.html
> Sent from the Camel - Users mailing list archive at Nabble.com.



-- 
Claus Ibsen
-----------------
FuseSource
Email: cibsen@fusesource.com
Web: http://fusesource.com
Twitter: davsclaus, fusenews
Blog: http://davsclaus.com
Author of Camel in Action: http://www.manning.com/ibsen

Re: dynamic filename endpoint

Posted by jtoepfer <jt...@brookdaleliving.com>.
Claus,

   I was actually looking at the  http://camel.apache.org/file2.html File2 
reference of creating a filename.  I thought I should be able to do the same
with FTP, is that not correct? 

This was the File Language example given:  mydata-${date:now:yyyyMMdd}.txt

Thanks again for your help.

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

Re: dynamic filename endpoint

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

Are you using spring property placeholders by any chance?
I wonder if it interfere. It has an option to ignore unknown properties.


On Mon, Jun 25, 2012 at 8:14 PM, jtoepfer <jt...@brookdaleliving.com> wrote:
> I am using Apache Camel 2.7 with ActiveMQ 5.5.1.
>
> I am trying to setup an endpoint filename with dynamic date, can someone
> help.  I keep getting an error with the following...
>
>
> <endpoint id="ftpEndpoint"
>
> uri="ftp://abc@ftp.sample.com/OUT/Test?fileName=file-${date:now:yyyyMMdd}.xml"
> />
>
> If I take off ${date:now:yyyyMMdd} the data gets sent to the file correctly.
> I'm looking for some direction, being very new to camel.
>
> Thanks in advance.
>
>
> --
> View this message in context: http://camel.465427.n5.nabble.com/dynamic-filename-endpoint-tp5715076.html
> Sent from the Camel - Users mailing list archive at Nabble.com.



-- 
Claus Ibsen
-----------------
FuseSource
Email: cibsen@fusesource.com
Web: http://fusesource.com
Twitter: davsclaus, fusenews
Blog: http://davsclaus.com
Author of Camel in Action: http://www.manning.com/ibsen