You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@camel.apache.org by Daniel Lorych <DA...@dongenergy.dk> on 2014/05/08 10:07:46 UTC

File monitor does not work with spring properties

Hi,

It seems that file monitor functionality fails when using spring properties via BridgePropertyPlaceholderConfigurer.

When directory and filename are explicitly configured in the URI file the route works fine - file is being picked up on changes
--- route ---
<from uri="file:target/export?fileName=continousExport.csv&amp;noop=true&amp;idempotentKey=${file:name}-${file:modified}" />
<to uri="stream:out" />

When directory and/or filename are referenced by spring properties the file is being read only once, and it is not being picked up on changes.
--- route ---
<from uri="file:{{export.dir}}?fileName={{export.file}}&amp;noop=true&amp;idempotentKey=${file:name}-${file:modified}" />
<to uri="stream:out" />
--- properties ---
export.dir=target/export
export.file=continousExport.csv

Tested on 2.12.2, 2.12.3 and 2.13.0.

Not sure, whether it's a limitation of BridgePropertyPlaceholderConfigurer, bug in endpoint initialisation or something else.
It would be great if you could comment on this, before me going to dig into this.


Regards,
Daniel


Z powazaniem
Daniel Lorych
System Consultant
Team Deal Life Cycle

DONG Energy
www.dongenergy.com<http://www.dongenergy.com/>


Re: File monitor does not work with spring properties

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

This is working as expected. Spring property placeholder is a one time thing.

On Thu, May 8, 2014 at 10:07 AM, Daniel Lorych <DA...@dongenergy.dk> wrote:
> Hi,
>
> It seems that file monitor functionality fails when using spring properties via BridgePropertyPlaceholderConfigurer.
>
> When directory and filename are explicitly configured in the URI file the route works fine - file is being picked up on changes
> --- route ---
> <from uri="file:target/export?fileName=continousExport.csv&amp;noop=true&amp;idempotentKey=${file:name}-${file:modified}" />
> <to uri="stream:out" />
>
> When directory and/or filename are referenced by spring properties the file is being read only once, and it is not being picked up on changes.
> --- route ---
> <from uri="file:{{export.dir}}?fileName={{export.file}}&amp;noop=true&amp;idempotentKey=${file:name}-${file:modified}" />
> <to uri="stream:out" />
> --- properties ---
> export.dir=target/export
> export.file=continousExport.csv
>
> Tested on 2.12.2, 2.12.3 and 2.13.0.
>
> Not sure, whether it's a limitation of BridgePropertyPlaceholderConfigurer, bug in endpoint initialisation or something else.
> It would be great if you could comment on this, before me going to dig into this.
>
>
> Regards,
> Daniel
>
>
> Z powazaniem
> Daniel Lorych
> System Consultant
> Team Deal Life Cycle
>
> DONG Energy
> www.dongenergy.com<http://www.dongenergy.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
hawtio: http://hawt.io/
fabric8: http://fabric8.io/