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