【问题标题】:Spring Integration - Delay poller for mail inbound channel adapter not consideredSpring Integration - 未考虑邮件入站通道适配器的延迟轮询器
【发布时间】:2012-11-03 02:33:01
【问题描述】:


我已经配置了一个入站通道适配器来接收邮件,并设置了一个固定延迟 = 15000 的轮询器。
当 max-messages-per-poll 设置为低值(小于邮箱文件夹中的邮件数)时,触发器每 15 秒正确触发一次。
但如果 max-messages-per-poll 设置为较高值,则每隔大约 2 秒调用一次 Pop3MailReceiver,并且不考虑固定延迟或 cron 设置。
我的错在哪里?
提前感谢您的帮助。

<util:properties id="javaMailProperties">
    <prop key="mail.pop3.socketFactory.class">javax.net.ssl.SSLSocketFactory</prop>
    <prop key="mail.pop3.socketFactory.fallback">false</prop>
    <prop key="mail.store.protocol">pop3s</prop>
</util:properties>

<mail:inbound-channel-adapter id="mailAdapter"
              store-uri="pop3s://xxxxxxxxxx%40xxxxxxxxx.xxxxx:xxxxxxxxx@xxxxxxx:xxx/inbox"
              channel="receiveEmailChannel"
              should-delete-messages="false"
              java-mail-properties="javaMailProperties"
              auto-startup="false">
        <int:poller max-messages-per-poll="10" fixed-delay="15000"/>
</mail:inbound-channel-adapter>

<int:control-bus input-channel="receiveEmailChannel"/>

<int:channel id="receiveEmailChannel">
    <int:interceptors>
        <int:wire-tap channel="logger"/>
    </int:interceptors>
</int:channel>

<int:logging-channel-adapter id="logger" level="DEBUG"/>

<int:service-activator input-channel="receiveEmailChannel" ref="mailNotificationDetector" method="receive"/>

【问题讨论】:

    标签: spring email integration


    【解决方案1】:

    documentation 看来,这是预期的行为,轮询将重复进行,直到满足 max-messages-per-poll 数量。

    因此,当您的 max-messages-per-poll 较低时,这个数字可以通过一些可能很快完成的轮询调用来满足,并且您可以看到一个干净的固定延迟调用。当您的 max-messages-per-poll 很高时,可能需要进行相当多的 poll 调用才能满足 max-messages-per-poll 调用。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2023-03-12
      • 2014-06-29
      • 2019-12-04
      • 1970-01-01
      • 1970-01-01
      • 2016-07-19
      • 2016-11-17
      • 2017-10-08
      相关资源
      最近更新 更多