On Mon, Oct 12, 2009 at 3:50 PM, sub3 <[email protected]> wrote:
>
> Thanks.  That got me past the compilation errors, but I am not able to get it
> to trigger in 2.0.
>
> Below is the same code from when I was integrated with 1.3.0 (Except
> removing FileExchange).  I don't know if the file handling is correct, but
> my problem is that I don't even get to that code.  process() never gets
> called when files are dropped in.  Is there something new I need to do?
> Thanks.
>

This code
>      File file = (File)e.getIn();

Should be
File file = e.getIn().getBody(File.class);

What does the string "dir" contain?

You can always try to simplify by doing
from("file://" + dir).to("log:foo");

And have logging at INFO level.
To see if the files is picked up.



>
> from("file://"+dir).errorHandler(deadLetterChannel("bean:DeadLetterChannelProcessor/handleError").maximumRedeliveries(1)).process(new
> Processor() {
>  public void process(Exchange e) {
>    logger.error("Exchanged called!!!");
>    try {
>      File file = (File)e.getIn();
>      logger.debug("Filename: " + file.toString());
>      long start = System.currentTimeMillis();
>      FileInputStream fis = new FileInputStream(file);
>      handle(fis, file);
>      fis.close();
>      long end = System.currentTimeMillis();
>      logger.info(String.format(        "Runtime %1$d ms (%2$d to %3$d)",(end -
> start), start, end));
>    } catch (Exception ex) {
>      ex.printStackTrace();
>    }
>  }
> });
>
>
>
>
>
>
> Claus Ibsen-2 wrote:
>>
>> On Fri, Oct 9, 2009 at 4:55 PM, sub3 <[email protected]> wrote:
>>>
>>> I am trying to upgrade my system from 1.3.0 to 2.0.0.  I can't seem to
>>> find
>>> org.apache.camel.component.file.FileExchange.
>>>
>>> When I look at the javadocs online, it is there, but I can't find it in
>>> any
>>> of the jars. Do I need to compile it myself, or am I just overlooking
>>> something?
>>>
>>
>> The javadocs online is outdated. The apache infrastructure is playing
>> tricks on us so we cant always update it when we do new releases.
>>
>> In Camel 2.0 there is only a single Exchange now =
>> org.apache.camel.impl.DefaultExchange.
>> There are no more specialized exchanges.
>>
>>
>>
>>> Thanks for your help.
>>>
>>> --
>>> View this message in context:
>>> http://www.nabble.com/Upgrading-to-2.0---Using-FileExchange-tp25822604p25822604.html
>>> Sent from the Camel - Users mailing list archive at Nabble.com.
>>>
>>>
>>
>>
>>
>> --
>> Claus Ibsen
>> Apache Camel Committer
>>
>> Open Source Integration: http://fusesource.com
>> Blog: http://davsclaus.blogspot.com/
>> Twitter: http://twitter.com/davsclaus
>>
>>
>
> --
> View this message in context: 
> http://www.nabble.com/Upgrading-to-2.0---Using-FileExchange-tp25822604p25856153.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>
>



-- 
Claus Ibsen
Apache Camel Committer

Open Source Integration: http://fusesource.com
Blog: http://davsclaus.blogspot.com/
Twitter: http://twitter.com/davsclaus

Reply via email to