Apache camel multicast FreeMarker

為{幸葍}努か 提交于 2019-12-13 02:25:30

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!