Announcement Announcement Module
Collapse
No announcement yet.
Spring Mail: about the usage of AbstractMailReceiver Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Spring Mail: about the usage of AbstractMailReceiver

    Hello,

    I am reading AbstractMailReceiver and got one question as below:

    Code:
           /**
    	 * Specify the maximum number of Messages to fetch per call to {@link #receive()}.
    	 */
    	public void setMaxFetchSize(int maxFetchSize) {
    		this.maxFetchSize = maxFetchSize;
    	}
    If I don't set maxFetchSize and there are tons of emails on the server, I think it may cause out of memory problem at my side? If I set maxFetchSize, I need to call receive() in a loop but how can I specify to get the next maxFetchSize messages?

    Thanks!

  • #2
    It simply restricts the number of messages fully retrieved on each poll.

    If you are using IMAP and the server supports SEEN; the next fetch will retrieve the next N messages because the current set is marked as SEEN.

    If you are using POP3 you have to delete the retrieved messages in order to get the next set.

    Comment


    • #3
      Thanks a lot for the confirmation!

      Comment

      Working...
      X