我需要将两个不同的 XML(由 FreeMarker)发送到两个不同的端点。 即
.to("freemarker:templates/xml1.ftl").to("file://C:\\testXmls1")
和
.to("freemarker:templates/xml2.ftl").to("file://C:\\testXmls2")
我查看了 multicast()
函数,但我不知道当有两个 .to 时如何应用它
有人可以帮我吗?
最佳答案
是的,您可以在同一个 .to(uri1, uri2, ...) 中指定多个端点,然后它就变成单个“eip”。
multicast()
.to(uri1a, uri1b)
.to(uri2a, uri2b)
.end() // to end multicast
否则,您必须使用管道 eip 将其括起来。
multicast()
.pipeline().to(uri1a).to(uri1b).end() // to end this pipeline
.pipeline().to(uri2a).to(uri2b).end() // to end this pipeline
.end() // to end multicast
关于java - Apache Camel 多播 FreeMarker,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13471945/