Poolenrich()Allways在汇总返回一封电子邮件

问题描述 投票:0回答:1
Apache骆驼的跟随路线:

... ... .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(..)

-imap是商店而不是协议。 尝试使用

enrich()

-与
pollEnrich()
相同的行为
使用了所有ai-没有运气... :(
	

您可以尝试使用
apache-camel gmail imap
1个回答
0
投票
+

split()

而不是单独使用
pollEnrich()
enrich()
。以下代码可能会有所帮助:
`.enrich()
.simple("imap://${exchangeProperty.imapEndpoint}...")
.aggregationStrategy(AggregationStrategies.groupedBody())
.split(body())
.process(imapProcessor)
.end();`
AS

pollEnrich()
无法在多个消息上循环。
希望这解决了您的问题。


最新问题
© www.soinside.com 2019 - 2025. All rights reserved.