开发者

ActiveMQ & Camel - How to create dependency in routing paths

I have a message routing to implement, which has routes that vary according to the message content. Some strands of the route are dependent on other.

If for example I have Data_A which has Task_A and Task_B to be performed on it. Whereas Data_B has only Task_B to be performed on it开发者_如何学C.

Here each Task has a queue served by consumers.

If Task_A should be performed only after Task_B if Task_B is requested on the data, how do I set-up such dependencies?


You can use several routes to branch out the workflow, like this

from("queue:start").
  choice().xpath("//foo")).to("queue:taskB").
  otherwise().to("queue:taskA");

from("queue:taskB").process(new DoTaskB()).to("queue:taskA");

from("queue:taskA").process(new DoTaskA()).to("queue:done");
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜