You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by Jimi Hullegård <ji...@mogul.com> on 2010/03/16 19:45:04 UTC

Route stops executing/polling input folder after first "run"

Hi,

I'm just getting started with Camel, and I have a very basic question that hopefully someone here can answer.

If I set up a simple test route, like this:

  <route>
   <from uri="file:C:/somepath/in"/>
   <to uri="file:C:/somepath/out"/>
  </route>

then this route works just fine. If I copy a bunch of files to the in-folder, the gets moved to the out-folder, and it can be repeated over and over again.

If I, however, expand this route using a custom component "shs" like this:

  <route>
   <from uri="file:C:/shs/test-install/nod1/cameltest/in"/>
   <setExchangePattern pattern="InOut"/>
   <to uri="log:camel_shs_input?level=ERROR"/>
   <to uri="shs:localhost_nod2?productId=2ff045ca-16a6-476b-a350-e9397c07fef1&amp;to=1111111111"/>
   <to uri="log:camel_shs_output?level=ERROR"/>
   <setHeader headerName="org.apache.camel.file.name">
     <constant>response-${bean:uuidGenerator.randomUUID}.txt</constant>        
   </setHeader>
   <to uri="file:C:/shs/test-install/nod1/cameltest/out"/>
  </route>

then the route only works only once. That is, if I copy a bunch of files to the in-folder they gets processed successfully and the resulting files are written to the out-folder, but if I try do to it again then nothing happens. The files remain in the in-folder, and nothing is logged in the console running camel (using "mvn camel:run").

The only way to get it working again is to stop camel, and then start it again.

Does anyone have any idéa of what could be wrong? Why does it stop polling the in-folder (with out any logged errors)? What are the best way to troubleshoot this?

Regards
/Jimi

SV: Route stops executing/polling input folder after first "run"

Posted by Jimi Hullegård <ji...@mogul.com>.
OK, I found the answer... I guess I was a bit tired after a long day, and 1) didn't read the file component documentation thoroughly and 2) forgot to turn on debug logging. duh...

The debug logging really helped me look in the right direction. I reused the same test files each time, and by default the File component ignores files that it thinks it has seen before. So I simply added the uri parameter consumer.alwaysConsume=true and voila, it worked.

/Jimi

________________________________________
Från: Jimi Hullegård [jimi.hullegard@mogul.com]
Skickat: den 16 mars 2010 19:45
Till: users@camel.apache.org
Ämne: Route stops executing/polling input folder after first "run"

Hi,

I'm just getting started with Camel, and I have a very basic question that hopefully someone here can answer.

If I set up a simple test route, like this:

  <route>
   <from uri="file:C:/somepath/in"/>
   <to uri="file:C:/somepath/out"/>
  </route>

then this route works just fine. If I copy a bunch of files to the in-folder, the gets moved to the out-folder, and it can be repeated over and over again.

If I, however, expand this route using a custom component "shs" like this:

  <route>
   <from uri="file:C:/shs/test-install/nod1/cameltest/in"/>
   <setExchangePattern pattern="InOut"/>
   <to uri="log:camel_shs_input?level=ERROR"/>
   <to uri="shs:localhost_nod2?productId=2ff045ca-16a6-476b-a350-e9397c07fef1&amp;to=1111111111"/>
   <to uri="log:camel_shs_output?level=ERROR"/>
   <setHeader headerName="org.apache.camel.file.name">
     <constant>response-${bean:uuidGenerator.randomUUID}.txt</constant>
   </setHeader>
   <to uri="file:C:/shs/test-install/nod1/cameltest/out"/>
  </route>

then the route only works only once. That is, if I copy a bunch of files to the in-folder they gets processed successfully and the resulting files are written to the out-folder, but if I try do to it again then nothing happens. The files remain in the in-folder, and nothing is logged in the console running camel (using "mvn camel:run").

The only way to get it working again is to stop camel, and then start it again.

Does anyone have any idéa of what could be wrong? Why does it stop polling the in-folder (with out any logged errors)? What are the best way to troubleshoot this?

Regards
/Jimi