When to use Camel Wiretap or SEDA?

In my Camel route, I need to send a message to JMS when an Exception removes my handlers onException

. To speed up the main route, I am trying to send messages asynchronously using Wiretap

I am trying to use something like this:

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

      

Do I need to use Wiretap , or can I only go with SEDA :

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

      

+3


source to share


2 answers


You don't need to use wiretap. Only queuing villages will work.



The Wiretap template should be used wherever you want to intercept messages between components for analysis or debugging purposes.

+2


source


An important difference between Wiretap and SEDA is that when consumed from polling consumers (like file or ftp ), only wire communication is fire and forget.



When the flow consuming the poll consumer reaches .to(seda:xx)

, it will cancel the exchange and continue the route as expected, or consume new exchanges from the endpoint. The exchange sent to the seda endpoint will be sent to the receiving consumer on the seda stream, not on the original consumer thread. This means that if you, for example, have a delete=true

poll consumer in your endpoint definition, the file will not be deleted until the seda stream finishes.

+2


source







All Articles