An application that uses Spring Integration (imap-idle-channel-adapter) and Spring Boot was deployed in a Weblogic Cluster environment (4 servers). The SI adapter imap-idle-channel-adapter pulls emails from Exchange Server fine if it is deployed in one server. However, if it is deployed in cluster (4 servers), the email is processed 4 times (one per each server).
Question: Is there any configuration or good practice for deploying this type of application in a cluster environment?
Using:
- Spring Boot 2.5.1
- Spring Integration Mail 5.5.0
- Weblogic 12c
A war file was created following this blog.
https://o7planning.org/11901/deploy-spring-boot-application-on-oracle-weblogic-server
The configuration of the imap-idle-channel-adapter and mail properties are like this.
<int-mail:imap-idle-channel-adapter id="customAdapter"
store-uri="imaps://[username]:[password]@imap.gmail.com/INBOX"
channel="receiveChannel"
auto-startup="true"
should-delete-messages="false"
auto-close-folder="false"
simple-content="true"
java-mail-properties="javaMailProperties"/>
<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>