Spring integration 如何在Spring集成邮件支持中轮询多封电子邮件
我需要轮询邮件服务器。由于我的项目已经在Spring中,我使用Spring集成来轮询邮件服务器。我在这方面很成功。但现在我不得不调查多封电子邮件。有人能告诉我怎么做吗 这是我用来轮询单个邮件的示例代码Spring integration 如何在Spring集成邮件支持中轮询多封电子邮件,spring-integration,Spring Integration,我需要轮询邮件服务器。由于我的项目已经在Spring中,我使用Spring集成来轮询邮件服务器。我在这方面很成功。但现在我不得不调查多封电子邮件。有人能告诉我怎么做吗 这是我用来轮询单个邮件的示例代码 <util:properties id="javaMailProperties"> <prop key="mail.imap.socketFactory.class">javax.net.ssl.SSLSocketFactory</prop>
<util:properties id="javaMailProperties">
<prop key="mail.imap.socketFactory.class">javax.net.ssl.SSLSocketFactory</prop>
<prop key="mail.imap.socketFactory.fallback">false</prop>
<prop key="mail.store.protocol">imaps</prop>
<prop key="mail.debug">false</prop>
</util:properties>
<mail:inbound-channel-adapter id="imapAdapter"
store-uri="${imap.uri}"
channel="recieveEmailChannel"
should-delete-messages="false"
should-mark-messages-as-read="true"
auto-startup="true"
java-mail-properties="javaMailProperties">
<int:poller fixed-delay="${imap.poolerSecondsDelay}" time-unit="SECONDS"/>
</mail:inbound-channel-adapter>
<int:channel id="recieveEmailChannel">
<int:interceptors>
<int:wire-tap channel="logger"/>
</int:interceptors>
</int:channel>
<int:logging-channel-adapter id="logger" level="DEBUG"/>
<int:service-activator input-channel="recieveEmailChannel" ref="emailReceiverService" method="receive"/>
<bean id="emailReceiverService" class="com.usbank.hermes.serviceimpl.EmailReceiverService">
</bean>
javax.net.ssl.SSLSocketFactory
假的
imaps
假的
将“每次轮询的最大消息数”添加到轮询器中
即:
每次轮询时,它将从队列中获取10封邮件
<int:poller max-messages-per-poll="10" fixed-delay="${imap.poolerSecondsDelay}" time-unit="SECONDS"/>