Spring integration 邮件:入站通道适配器返回类型

Spring integration 邮件:入站通道适配器返回类型,spring-integration,Spring Integration,我正在使用Java注释和ImapIdleChannelAdapter设置一个mail:inbound通道适配器 不清楚要从@InboundChannelAdapter传递到@ServiceActivator的对象类型 代码段: @InboundChannelAdapter(value = "inputChannel", poller = @Poller(fixedDelay = "5000")) public ImapIdleChannelAdapter getMailAdapter() {

我正在使用Java注释和
ImapIdleChannelAdapter
设置一个mail:inbound通道适配器

不清楚要从
@InboundChannelAdapter
传递到
@ServiceActivator
的对象类型

代码段:

@InboundChannelAdapter(value = "inputChannel", poller = @Poller(fixedDelay = "5000"))
public ImapIdleChannelAdapter getMailAdapter() {
    ImapMailReceiver mailReceiver = new ImapMailReceiver("imaps://username:password@map-mail.outlook.com:993/INBOX");
    ...
    return new ImapIdleChannelAdapter(mailReceiver);
}

@ServiceActivator(inputChannel = "inputChannel")
public void readMessage(Message<javax.mail.Message> message) {
    System.out.println(message.getPayload().getAllRecipients());
}

ImapIdleChannelAdapter
是一个事件驱动组件。这不是民意调查的来源。它将通过自己的内部任务生成消息

必须从配置中删除
@InboundChannelAdapter
,并添加简单的
@Bean
频道
必须直接配置一个
ImapIdleChannelAdapter
对象

@ServiceActivator(inputChannel = "inputChannel")
public void readMessage(javax.mail.Message message) throws MessagingException {
    System.out.println(message.getAllRecipients());
}