Ok, Thanks! As I see most of the components use maxMessagesPerPoll to limit processing of messages, after they have polled?
Ex: For mail component - int count = folder.getMessageCount(); might return 10,000 but it only process as per maxMessagesPerPoll - say 1000. And rest 9000 will be available for precessing in next poll when it invokes folder.getMessageCount(), right? In my scenario, external component hands off the message than those are not available back for 5mins. So I do not want to getMessage() unless I can process it right away. Would it make sense to limit getMessage() by maxMessagesPerPoll? Thanks! Claus Ibsen-2 wrote: > > On Thu, Mar 18, 2010 at 8:40 AM, tide08 <sachin2...@yahoo.com> wrote: >> >> Hi, >> >> I am writing custom component and I need a polling consumer but I am not >> sure, if the approach I am taking is correct. I need create >> scheduledPollingConsumer which polls external system to receive messages. >> >> Looking at other components SchedulePollingConsumers implement poll() >> method >> which works with "known" number of messages i.e. Mail, File - each know >> what >> number of messages to work with inside of poll() >> >> //mail >> int count = folder.getMessageCount(); >> >> But in my scenario, there is no way to know it until you receive "null" >> message from external system. So as I understand in my scenario, if there >> are tonnes of messages, this consumer will keep running indefinitely. How >> would this affect threadpool? >> >> How are ScheduledPollingConsumer supposed to behave? Consume as much in >> polling interval? or consume restrictively so that the scheduled run ends >> before the next schedule? >> > > There is only one task scheduled, so if your poll takes 5 seconds or > 37 minutes to complete does not matter. > > You can add an option to limit the number of intakes as we have the > maxMessagesPerPoll option on eg BatchConsumers. > If you are worried to run _forever_ :) > > >> Please advice. Thanks! >> >> >> -- >> View this message in context: >> http://old.nabble.com/ScheduledPollConsumer---poll%28%29-behavior--tp27942516p27942516.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 > > -- View this message in context: http://old.nabble.com/ScheduledPollConsumer---poll%28%29-behavior--tp27942516p27947271.html Sent from the Camel - Users mailing list archive at Nabble.com.