Hi You would need to use the idempotent consumer EIP to filter out duplicates etc http://camel.apache.org/idempotent-consumer.html
Otherwise you would need to either delete or mark the mails as seen on the mail server, so on next poll the previous mails is not consumed again. On Fri, Oct 5, 2012 at 7:41 PM, Ketan Barapatre <ketanbarapa...@gmail.com> wrote: > Hello All, > > I am reading mail using Mail Component http://camel.apache.org/mail.html > > I have created following Route > > from("imaps://imap.gmail.com?username=" + user.getUserName() + "&password=" > + user.getPassword() > + > "&unseen=false&fetchSize=10&consumer.delay=100").filter(messageFilter).process(mailProcessor); > > Now, I am expecting to get all read and unread mails from INBOX > folder. When I run my app I am able to get all read and unread mail from > INBOX but > Mail reading starts from very first mail(from INBOX) and when last > mail(latest mail from INBOX) is fetch it again starts reading mail from > first mail(from INBOX) but I am expecting it should stop after reading last > mail (which is latest mail) from INBOX. So I found that Polling to INBOX > start again it goes in loop. > > Please suggest me How can I stop looping when mail reading is done. > Or is there any way I can poll my mail box to get mail only from specified > start date upto specified end date or > > Please correct me if i'm not clear with question or suggest me How can do > this. > > Thank You > Ketan -- Claus Ibsen ----------------- Red Hat, Inc. FuseSource is now part of Red Hat Email: cib...@redhat.com Web: http://fusesource.com Twitter: davsclaus Blog: http://davsclaus.com Author of Camel in Action: http://www.manning.com/ibsen