Don't want to find similar solution, which I showed earlier, even on SO. But as you say that you are newbie, so I just provide the solution for you.
Well, supose you have something like this now:
<int-mail:inbound-channel-adapter store-uri="pop3:foo"
channel="channel">
<int:poller fixed-rate="60000"/>
</int-mail:inbound-channel-adapter>
On the background that configuration provides a bean for Pop3MailReceiver
.
To get worked you solution you should change <int-mail:inbound-channel-adapter/>
to this config:
<beans:bean id="pop3MailReceiver" class="org.springframework.integration.mail.Pop3MailReceiver"/>
<int:inbound-channel-adapter channel="getEmailsChannel" expression="''">
<int:poller fixed-rate="60000"/>
</int:inbound-channel-adapter>
<int:service-activator input-channel="getEmailsChannel" output-channel="processEmailsChannel"
expression="@pop3MailReceiver.receive()"/>
- Of course, you should provide appropriate properties to the
Pop3MailReceiver
- Generic
<int:inbound-channel-adapter>
triggers yourPop3MailReceiver
as it is in your case already invoking<int:service-activator>
<int:service-activator>
, in turn, just poll mail messages from POP3.
One point to pay attention, that MailReceiver#receive()
returns an array of mail messages, so maybe there is need to split it after receiving, to be consistent with <int-mail:inbound-channel-adapter/>
.