Forum Home » Fuse Distributions » Fuse Mediation Router

Thread: CAMEL file poller - FileNotFoundException

 

Permlink Replies: 6 - Last Post: May 6, 2010 10:57 AM Last Post By: divakar
sriram

Posts: 40
Registered: 06/09/09
CAMEL file poller - FileNotFoundException
Posted: Mar 24, 2010 11:47 AM
  Click to reply to this thread Reply
When I have a CAMEL file poller component and the file that starts the route has more than 20,000 characters in length, during the course of the route, I get a FileNotFoundException in a totally different directory.
Ex: FileNotFoundException : /var/tmp/camel-tmp-868919/cos38355tmp (No such file or directory)

Any clues on this?

Edited by: sriram on Mar 24, 2010 5:17 PM
davsclaus

Posts: 1,893
Registered: 10/14/08
Re: CAMEL file poller - FileNotFoundException
Posted: Mar 24, 2010 11:49 AM   in response to: sriram in response to: sriram
  Click to reply to this thread Reply
Its stream cache. Disable that. As it will auto spool to files when the data > 64kb.

In Camel 2.x stream cache is disabled by default.
sriram

Posts: 40
Registered: 06/09/09
Re: CAMEL file poller - FileNotFoundException
Posted: Mar 24, 2010 1:40 PM   in response to: davsclaus in response to: davsclaus
  Click to reply to this thread Reply
and in CAMEL 1.6?
davsclaus

Posts: 1,893
Registered: 10/14/08
Re: CAMEL file poller - FileNotFoundException
Posted: Mar 24, 2010 2:04 PM   in response to: sriram in response to: sriram
  Click to reply to this thread Reply
See here
http://camel.apache.org/stream-caching.html
sriram

Posts: 40
Registered: 06/09/09
Re: CAMEL file poller - FileNotFoundException
Posted: Mar 25, 2010 1:49 PM   in response to: davsclaus in response to: davsclaus
  Click to reply to this thread Reply
The FileNotFound is gone now by including the code in CAMEL 1.6 as
this.getContext().getProerties().put(CachedOutputStream.THRESHOLD,"0");

since when i use it in the camel-context.xml i get Invalid Property 'streamCache'.

But now i am getting
java.io.IOException: Bad file number
.
.
.
.
at org.apache.camel.converter.IOConverter.toString(IOConverter.java:209)
njiang

Posts: 572
Registered: 09/17/07
Re: CAMEL file poller - FileNotFoundException
Posted: Mar 26, 2010 12:24 AM   in response to: sriram in response to: sriram
  Click to reply to this thread Reply
If you want to active the File cache, you need to set threshold with a big number.
this.getContext().getProerties().put(CachedOutputStream.THRESHOLD,"10000000");


And you can also set the Temp file directory with this code
exchange.getContext().getProperties().put(achedOutputStream.TEMP_DIR, "\tmp\camel");
divakar

Posts: 38
Registered: 03/19/10
Re: CAMEL file poller - FileNotFoundException
Posted: May 6, 2010 10:57 AM   in response to: njiang in response to: njiang
  Click to reply to this thread Reply
This worked, Thanks...