...
...
.pollEnrich()
.simple("""
imap://${exchangeProperty.imapEndpoint}
?delay=0
&initialDelay=0
&additionalJavaMailProperties=#bean:${exchangeProperty.imapAdditionalPropertiesName}
&bridgeErrorHandler=true&disconnect=false
&closeFolder=false
&delete=${exchangeProperty.imapDelete}
&unseen=true
&maxMessagesPerPoll=-1
&username=RAW(${exchangeProperty.imapUsername})
&password=RAW(${exchangeProperty.imapPassword})
""")
.aggregationStrategy(
AggregationStrategies.flexible()
.pick(ExpressionBuilder.messageExpression())
.condition(Objects::nonNull)
.accumulateInCollection(HashSet.class)
.storeInBody()
)
.end()
.process(imapProcessor)
.end();
从处理日志中,可以看到MailCOnsumer
读取IMAP中所有必需的电子邮件。但是由于某种原因,
poolEnrich()
一直在set中返回一封电子邮件。注:IMAP服务器是Gmail.
如何返回所有电子邮件(汇总)
使用to(..)
enrich()
-与
pollEnrich()
相同的行为 使用了所有ai-没有运气... :(
您可以尝试使用
split()
而不是单独使用
pollEnrich()
或
enrich()
。以下代码可能会有所帮助:
`.enrich()
.simple("imap://${exchangeProperty.imapEndpoint}...")
.aggregationStrategy(AggregationStrategies.groupedBody())
.split(body())
.process(imapProcessor)
.end();`
ASpollEnrich()
无法在多个消息上循环。希望这解决了您的问题。