不读取所有邮件都在收件箱中使用多个MailID用于IntegrationFlows .from(邮件)

发布于 2025-02-12 04:43:18 字数 1850 浏览 2 评论 0原文

即使我将调度程序池大小配置为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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

南风几经秋 2025-02-19 04:43:18

如果您已经有一个入站通道适配器,则没有理由使用Queuechannel。另外:考虑使用imapidleadapter()。调度程序池中的这些5仍然不够:仅仅因为您有太多基于调度程序的任务:入站通道适配器和队列通道。

There is no reason to use QueueChannel, if you already have an Inbound Channel Adapter. Also: consider to use a imapIdleAdapter() instead. Probably those 5 in the pool for scheduler is still not enough: just because you have too many scheduler-based tasks: inbound channel adapters and queue channels.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文