1

我有两条路线 A 和 B 如下

from("some endpoint")  //route A
.to("direct:x")

from("direct:x")  //route B
.doTry()
   .bean("somebean")  //set Custom object PQR as message body 
.doCatch()
   .bean("some other bean")  //log exception
.end()

现在我想在路由 A 完成(已经完成)后调用路由 B。现在如何从路由 A 中的路由 B 获取响应 PQR 对象(仅当路由 B 成功时)?

4

1 回答 1

0

它应该自动执行此操作。如果to在 之后在路由 A 中链接另一个to("direct:x"),它将从路由 B 获取响应。您可以尝试在 之后记录正文to("direct:x")并检查结果。

于 2020-04-22T18:23:58.543 回答