Apache Camel从当前路线开始新的asynchrounus路线

时间:2018-01-26 13:12:01

标签: java multithreading apache-camel multicast

我正在尝试做这样的事情

from("direct:start")
    .to("direct:a")
    // I want this route to stop here (reply with the response from "direct a"
    // then starts "direct:async" in new thread because it will take time 
    // (more that route timeout 
    .to("direct:async");

1 个答案:

答案 0 :(得分:4)

您可以使用窃听。您从 direct:start 开始路由,然后使用 wireTap 发送异步交换的副本(启动新线程),您将继续使用直接路由:一个

from("direct:start").wireTap("direct:async").to("direct:a")