Apache骆驼组播FreeMarker [英] Apache camel multicast FreeMarker

查看:37
本文介绍了Apache骆驼组播FreeMarker的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要将两个不同的 XML(通过 FreeMarker)发送到两个不同的端点.即

I need to send two different XMLs (by FreeMarker) to two different endpoints. i.e.

.to("freemarker:templates/xml1.ftl").to("file://C:\\testXmls1")

.to("freemarker:templates/xml2.ftl").to("file://C:\\testXmls2")

我查看了 multicast() 函数,但是当有两个 .to 时我不知道如何应用它

I had a look at the multicast() function but I don't know how to apply it when there are two .to

有人可以帮我吗?

推荐答案

是的,您可以在同一个 .to(uri1, uri2, ...) 中指定多个端点,然后它会变成一个eip".

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

否则,您必须使用管道 eip 将其括起来.

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

这篇关于Apache骆驼组播FreeMarker的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆