2


我已经配置了一个入站通道适配器来接收邮件,并设置了一个固定延迟 = 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"/>
4

1 回答 1

2

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

So when you had a low max-messages-per-poll, this number was satisfied by a few polling calls which probably got completed fairly quickly and you could see a clean fixed-delay call. When you had a high max-messages-per-poll, it took probably quite a few poll calls to satisfy the max-messages-per-poll call.

于 2012-11-14T18:31:05.260 回答