【问题标题】:Apache camel multicast FreeMarkerApache骆驼多播FreeMarker
【发布时间】:2012-11-20 11:10:09
【问题描述】:

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

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

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

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

谁能帮帮我?

【问题讨论】:

    标签: java apache-camel freemarker multicast endpoints


    【解决方案1】:

    是的,您可以在同一个 .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
    

    【讨论】:

    • 非常感谢克劳斯
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2016-12-08
    • 2022-01-19
    • 1970-01-01
    相关资源
    最近更新 更多