何时使用 Camel Wiretap 或 SEDA?

cri*_*nge 5 asynchronous apache-camel

在我的 Camel Route 中,当异常遇到我的处理程序时,我需要向 JMS 发送消息onException为了加快主路由的速度,我尝试通过窃听异步发送消息

我尝试使用这样的东西:

onException().handled(true).logHandled(true)
  .wiretap("seda:another_queue").end();
...
from("seda:another_queue?concurrentConsumers=5")
  .to("jms:queue_for_my_exception_messages");
Run Code Online (Sandbox Code Playgroud)

是否有必要使用Wiretap,或者我可以只使用SEDA队列,如下所示:

onException().handled(true).logHandled(true)
  .to("seda:another_queue").end();
...
from("seda:another_queue?concurrentConsumers=5")
  .to("jms:queue_for_my_exception_messages");
Run Code Online (Sandbox Code Playgroud)

Hus*_*sha 4

您不需要使用窃听。只有 seda 队列才可以工作。

当您想要拦截组件之间的消息以进行分析或调试时,应使用窃听模式。