不读取所有邮件都在收件箱中使用多个MailID用于IntegrationFlows .from(邮件)
即使我将调度程序池大小配置为5
,有时它没有在收件箱中读取所有邮件。
@Bean
public IntegrationFlow customerCareMailFlow() {
return IntegrationFlows.from(Mail
.imapInboundAdapter("imap://" + property.getCustomerCareUserName() + ":"
+ property.getCustomerCarePassword() + "@" + property.getHost() + ":"
+ property.getPort() + "/INBOX")
.searchTermStrategy(this::generateSearchTerm).shouldMarkMessagesAsRead(true)
.userFlag("testSIUserFlag").simpleContent(true)
.javaMailProperties(p -> p.put(property.getMailDebugKey(), property.getMailDebugValue())
.put(property.getMailImapSSLEnableKey(), property.getMailImapSSLEnableValue())),
e -> e.autoStartup(true).poller(p -> p.fixedRate(1000)))
.channel(MessageChannels.queue(property.getCustomerCareChannelName()))
.get();
}
@Bean
public IntegrationFlow serviceDeskMailFlow() {
return IntegrationFlows
.from(Mail.imapInboundAdapter(
"imap://" + property.getServiceDeskUserName() + ":" + property.getServiceDeskPassword()
+ "@" + property.getHost() + ":" + property.getPort() + "/INBOX")
.searchTermStrategy(this::generateSearchTerm).shouldMarkMessagesAsRead(true)
.userFlag("testSIUserFlag").simpleContent(true)
.javaMailProperties(p -> p.put(property.getMailDebugKey(), property.getMailDebugValue())
.put(property.getMailImapSSLEnableKey(), property.getMailImapSSLEnableValue())),
e -> e.autoStartup(true).poller(p -> p.fixedRate(1000)))
.log(e -> e.getPayload())
.channel(MessageChannels.queue(property.getServiceDeskChannelName()))
.get();
}
Even though I configured the scheduler pool size as 5
, sometimes it's not reading all the mails are received in the inbox.
@Bean
public IntegrationFlow customerCareMailFlow() {
return IntegrationFlows.from(Mail
.imapInboundAdapter("imap://" + property.getCustomerCareUserName() + ":"
+ property.getCustomerCarePassword() + "@" + property.getHost() + ":"
+ property.getPort() + "/INBOX")
.searchTermStrategy(this::generateSearchTerm).shouldMarkMessagesAsRead(true)
.userFlag("testSIUserFlag").simpleContent(true)
.javaMailProperties(p -> p.put(property.getMailDebugKey(), property.getMailDebugValue())
.put(property.getMailImapSSLEnableKey(), property.getMailImapSSLEnableValue())),
e -> e.autoStartup(true).poller(p -> p.fixedRate(1000)))
.channel(MessageChannels.queue(property.getCustomerCareChannelName()))
.get();
}
@Bean
public IntegrationFlow serviceDeskMailFlow() {
return IntegrationFlows
.from(Mail.imapInboundAdapter(
"imap://" + property.getServiceDeskUserName() + ":" + property.getServiceDeskPassword()
+ "@" + property.getHost() + ":" + property.getPort() + "/INBOX")
.searchTermStrategy(this::generateSearchTerm).shouldMarkMessagesAsRead(true)
.userFlag("testSIUserFlag").simpleContent(true)
.javaMailProperties(p -> p.put(property.getMailDebugKey(), property.getMailDebugValue())
.put(property.getMailImapSSLEnableKey(), property.getMailImapSSLEnableValue())),
e -> e.autoStartup(true).poller(p -> p.fixedRate(1000)))
.log(e -> e.getPayload())
.channel(MessageChannels.queue(property.getServiceDeskChannelName()))
.get();
}
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
如果您已经有一个入站通道适配器,则没有理由使用
Queuechannel
。另外:考虑使用imapidleadapter()
。调度程序池中的这些5
仍然不够:仅仅因为您有太多基于调度程序的任务:入站通道适配器和队列通道。There is no reason to use
QueueChannel
, if you already have an Inbound Channel Adapter. Also: consider to use aimapIdleAdapter()
instead. Probably those5
in the pool for scheduler is still not enough: just because you have too many scheduler-based tasks: inbound channel adapters and queue channels.