Вопрос:

Imap Idle channel adaptor on load balanced Servers

spring-integration

78 просмотра

1 ответ

16 Репутация автора

I have the below configuration for my incoming mail adapter. Everything is working fine when application is running on a single server. But when I deploy the application in a load balanced servers listening to the same mail box then the mail is being read in all the server. How to handle this scenario? Are there any specific configuration to handle such scenarios.

<int-mail:imap-idle-channel-adapter
    id="customAdapter"
    store-uri="${mail.protocol}://${mail.username}:${mail.password}@${mail.host}:${mail.port}/${mail.folder}"
    channel="recieveEmailChannel" auto-startup="true"
    should-delete-messages="false" 
    should-mark-messages-as-read="true"
    java-mail-properties="javaMailProperties" 
    mail-filter-expression="subject matches '(?i).*Email Notification.*'" />

<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">true</prop>
    <prop key="mail.imap.starttls.enable">true</prop>
    <prop key="mail.imaps.ssl.trust">${mail.ssl.trust}</prop>
    <prop key="mail.imaps.usesocketchannels">true</prop>
</util:properties>

<int:service-activator input-channel="recieveEmailChannel" expression="@emailService.process(payload)" />
Автор: Atif Siddiqui Источник Размещён: 08.11.2017 10:57

Ответы (1)


1 плюс

74047 Репутация автора

One of them is a Leader Election by the same role for the <int-mail:imap-idle-channel-adapter>.

And another is a Idempotent Receiver to track duplicates in the shared MetadataStore.

Автор: Artem Bilan Размещён: 08.11.2017 11:50
Вопросы из категории :
32x32