我有两条路线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成功的情况下)?
解决方案:
它应该是自动做的。如果你链上另一个 to
途径A后 to("direct:x")
你可以尝试在路径B之后记录正文。to("direct:x")
并检查结果。