GH-3619: Fix Mail Receiver fetch redundant Messages
Fixes https://github.com/spring-projects/spring-integration/issues/3619 The `AbstractMailReceiver` fetche redundant messages, causing performance problems * Use correct, already filtered, array of message to fetch **Cherry-pick to `main` & `5.3.x`**
This commit is contained in:
committed by
Artem Bilan
parent
55876e0e42
commit
b8785e5f9c
@@ -65,6 +65,7 @@ import org.springframework.util.MimeTypeUtils;
|
||||
* @author Gary Russell
|
||||
* @author Artem Bilan
|
||||
* @author Dominik Simmen
|
||||
* @author Yuxin Wang
|
||||
*/
|
||||
public abstract class AbstractMailReceiver extends IntegrationObjectSupport implements MailReceiver, DisposableBean {
|
||||
|
||||
@@ -413,7 +414,7 @@ public abstract class AbstractMailReceiver extends IntegrationObjectSupport impl
|
||||
}
|
||||
this.logger.debug(() -> "found " + messagesToProcess.length + " new messages");
|
||||
if (messagesToProcess.length > 0) {
|
||||
fetchMessages(messages);
|
||||
fetchMessages(messagesToProcess);
|
||||
}
|
||||
|
||||
this.logger.debug(() -> "Received " + messagesToProcess.length + " messages");
|
||||
|
||||
Reference in New Issue
Block a user