camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Claus Ibsen <claus.ib...@gmail.com>
Subject Re: Files ignored on second scan of directory
Date Thu, 11 Feb 2010 19:12:11 GMT
On Thu, Feb 11, 2010 at 4:58 PM, JohnMal <jmalanaphy@opt2vote.com> wrote:
>
> Hi,
>
> I am using Camel 2.1.0.
>
> The behaviour does look similar to that described in the 1.5 gotchas in that
> the file to be picked up has not changed between scans.  Will 2.1 ignore
> files that haven't changed on second and subsequent scans?
>

Enable DEBUG loggin on the component and see what it logs.

>
>
> Ashwin Karpe wrote:
>>
>> Hi,
>>
>> If you are using Camel 1.X the following applies
>>
>> Please check out  http://camel.apache.org/file.html
>> http://camel.apache.org/file.html  section "File consumer, scanning for
>> new files gotcha"
>>
>> The file consumer scans for new files by keeping an internal modified
>> timestamp of the last consumed file. So if you copy a new file that has an
>> older modified timestamp, Camel will not pick up this file. This can
>> happen if you are testing and you copy the same file back to the folder
>> that has just been consumed. To remedy this, modify the timestamp before
>> copying the file back.
>>
>> Cheers,
>>
>> Ashwin...
>>
>>
>> JohnMal wrote:
>>>
>>> I am trying to copy files and change their contents based on an incoming
>>> JMS message.  If the same file name is passed in more then once the
>>> consumer only picks up the file on the first message.  I have tried
>>> putting "&idempotent=false" on the url but it made no difference.
>>>
>>> from("activemq:queue:crossBoundaryCouncils").process(new Processor() {
>>>      public void process(final Exchange exchange) throws Exception {
>>>
>>>      // Get Header properties
>>>      Message message = (Message) exchange.getIn();
>>>      final String filename = (String) message.getHeader("filename");
>>>      final String councilAuthorityCode = (String)
>>> exchange.getIn().getHeader("councilAuthorityCode");
>>>      final String childAuthorityCode = (String)
>>> exchange.getIn().getHeader("childAuthorityCode");
>>>
>>>      String url = getFileRepository().getEndpointUri() +
>>> "?readLock=none&fileName=" + filename;
>>>
>>>      Endpoint endpoint = getContext().getEndpoint(url);
>>>      PollingConsumer consumer = endpoint.createPollingConsumer();
>>>      consumer.start();
>>>      Exchange pollExchange = consumer.receive();
>>>      consumer.stop();
>>>      String body = pollExchange.getIn().getBody(String.class);
>>>
>>>
>>>      String childFilename = filename;
>>>      childFilename = StringUtils.replace(childFilename, councilAuthorityCode,
>>> childAuthorityCode);
>>>
>>>      String childBody = StringUtils.replace(body, councilAuthorityCode,
>>> childAuthorityCode);
>>>
>>>      exchange.getOut().setHeader("parentFilename",filename);
>>>      exchange.getOut().setHeader("childAuthorityCode",childAuthorityCode);
>>>      exchange.getOut().setHeader(Exchange.FILE_NAME,childFilename);
>>>
>>>      exchange.getOut().setBody(childBody);
>>>
>>>      }
>>>   }).to(file://C://fileserver);
>>>
>>> Camel version 2.1.0
>>> WIndows XP
>>>
>>>
>>>
>>
>>
>
> --
> View this message in context: http://old.nabble.com/Files-ignored-on-second-scan-of-directory-tp27547556p27549269.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>
>



-- 
Claus Ibsen
Apache Camel Committer

Author of Camel in Action: http://www.manning.com/ibsen/
Open Source Integration: http://fusesource.com
Blog: http://davsclaus.blogspot.com/
Twitter: http://twitter.com/davsclaus

Mime
View raw message