ActiveMQ 与Camel - 如何在路由路径中创建依赖关系

发布于 2024-08-29 14:40:44 字数 214 浏览 3 评论 0原文

我有一个要实现的消息路由,它的路由根据消息内容而变化。路线的某些部分依赖于其他部分。

例如,如果我有 Data_A,其中有 Task_A 和 Task_B 要对其执行。 而 Data_B 只需要执行 Task_B。

这里每个任务都有一个由消费者服务的队列。

如果在数据上请求 Task_B 时,Task_A 仅应在 Task_B 之后执行,那么如何设置此类依赖关系?

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.

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?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

半世蒼涼 2024-09-05 14:40:44

您可以使用多个路线来分支工作流程,如下所示

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");

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");
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文