在Camel中使用带有recipientList的smtp

时间:2014-05-29 11:10:16

标签: apache-camel

我正在尝试在recipientList中使用SMTP组件。

.recipientList(simple("smtps://smtp.gmail.com?username=abc@gmail.com&password=RAW(abc)&to=${header.alertTo}&subject=RAW(alert)"));

当$ {header.alertTo}的值只是一个电子邮件地址时,这是有效的。但是,如果是逗号分隔的地址列表,则抛出异常。

No endpoint could be found for: def@gmail.com&subject=RAW(Alert), please check your classpath contains the needed Camel component jar. and the stracktrace is org.apache.camel.NoSuchEndpointException: No endpoint could be found for: def@gmail.com&subject=RAW(Alert), please check your classpath contains the needed Camel component jar.
    at org.apache.camel.util.CamelContextHelper.getMandatoryEndpoint(CamelContextHelper.java:65)
    at org.apache.camel.util.ExchangeHelper.resolveEndpoint(ExchangeHelper.java:85)
    at org.apache.camel.processor.RecipientListProcessor.resolveEndpoint(RecipientListProcessor.java:223)
    at org.apache.camel.processor.RecipientListProcessor.createProcessorExchangePairs(RecipientListProcessor.java:163)
    at org.apache.camel.processor.MulticastProcessor.process(MulticastProcessor.java:208)
    at org.apache.camel.processor.RecipientList.sendToRecipientList(RecipientList.java:153)
    at org.apache.camel.processor.RecipientList.process(RecipientList.java:112)
    at org.apache.camel.processor.Pipeline.process(Pipeline.java:118)
    at org.apache.camel.processor.Pipeline.process(Pipeline.java:80)

我之前使用"来"发送这些邮件。这很好。但后来由于涉及不同路由的可配置电子邮件地址的更改,我必须使用recipientList。

1 个答案:

答案 0 :(得分:1)

您可以将收件人列表中的分隔符字符更改为逗号以外的其他字符。

请参阅文档以了解如何操作