You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by alexey-s <al...@mail.ru> on 2012/02/01 10:48:30 UTC

Re: How to stop the Polling Consumer?

Hi, thanks for confirmation. 

File Consumer is the successor of Pool Consumer and Batch Consumer.
When you create a File Consumer, uses a pool of 10 threads.
The first thread scans and finds the N files. Consumer runs in a loop
processing of these files. This is how the Batch Consumer.
After the time specified for 'delay', the second thread is started. The new
thread is M new files. This is how the Pool Consumer.

Using a stop in route policy leads to the termination of all threads of Pool
Consumer and stop processing the remaining files in the Batch Consumer.

Stop Batch Consumer timer leads to the fact that the process may stop at the
transition from one to another prosessa.

<route>
   <form uri="file:/mypath">
   <to uri="bean:baeanA"/>
   <to uri="bean:baeanB"/>
</ route>

Can I stop Batch Consumer after all processing of the current message?

Can I stop the current route waiting for the orderly shutdown of the other
threads Pool Consumer?

<route>
   <form uri="file:/mypath?sendEmptyMessageWhenIdle=true">
   <choice>
     <when>
        <simple> $ {in.body} == null </ simple>
        <stop/>
     </ when>
   </ choice>
   <to uri="bean:baeanA"/>
   <to uri="bean:baeanB"/>
</ route>


--
View this message in context: http://camel.465427.n5.nabble.com/How-to-stop-the-Polling-Consumer-tp5443781p5446996.html
Sent from the Camel - Users mailing list archive at Nabble.com.