I created an imap-idle-chael-adapter in my spring integration app to get mails from the server as fast as they are received. This is my configuration settings for the adapter:
<int:poller default="true" fixed-delay="50"/>
<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>
<int-mail:imap-idle-chael-adapter id="imapAdapter"
store-uri="${IMAP_URI}"
chael="mailChael"
auto-startup="true"
should-delete-messages="false"
should-mark-messages-as-read="true"
java-mail-properties="javaMailProperties"/>
<int:chael id="mailChael">
<int:queue />
</int:chael>
<bean id="mailTransformer" class="com.rafboard.integration.transformer.InboundMailTransformer" />
<int:transformer id="inboundMailTransformer" input-chael="mailChael"
ref="mailTransformer" method="transform" output-chael="dataOutChael"/>
Everything seems to work right but in my logs I can see that there is no push notifications, the mail received is being pulled from the server every two minutes approximately.
2016-08-07 19:12:08.202 INFO 3 --- [ask-scheduler-4] o.s.integration.mail.ImapMailReceiver : attempting to receive mail from folder [INBOX]
2016-08-07 19:14:10.933 INFO 3 --- [ask-scheduler-9] o.s.integration.mail.ImapMailReceiver : attempting to receive mail from folder [INBOX]
2016-08-07 19:16:13.621 INFO 3 --- [ask-scheduler-8] o.s.integration.mail.ImapMailReceiver : attempting to receive mail from folder [INBOX]
Is there a way to speed up this? I thought ImapIdleChaelAdapter should received notification directly from mail server as soon as a mail is received but this is not like is behaving in my case.
PD: Mail server used is gmail.
