问题
I need to send two different XMLs (by FreeMarker) to two different endpoints. i.e.
.to("freemarker:templates/xml1.ftl").to("file://C:\\testXmls1")
and
.to("freemarker:templates/xml2.ftl").to("file://C:\\testXmls2")
I had a look at the multicast()
function but I don't know how to apply it when there are two .to
Could anyone please help me?
回答1:
Yes you can specify multiple endpoints in the same .to(uri1, uri2, ...) then it becomes as a single "eip".
multicast()
.to(uri1a, uri1b)
.to(uri2a, uri2b)
.end() // to end multicast
Otherwise you would have to enclose it using the pipeline 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
来源:https://stackoverflow.com/questions/13471945/apache-camel-multicast-freemarker