The default behaviour of wireTap and multicast in Camel seems to be similar. That is both of them helps in processing the same message in different ways. Then what is the main difference between wireTap and multicast?
@Srikanth -
I don't think you can achieve concurrency by using wireTap
It is not quite correct. Concurrency will be there with WireTap as well as with Multicast with parallel processing.
It is main purpose of WireTap. As example for logging or auditing outside of main thread to do not slow main thread for non-functional operations.
Difference is:
WireTap is "one-way fork". Message goes to wire-tapped endpoint in different thread parallel to main and there is no way to get response back from it to main thread.
Also it is possible to send to the wire-tapped endpoint other than main body, headers etc.
With Multicast it is possible to "split-then-aggregate" results in main thread after parallel or sequential processing.
Also it is not limited how many endpoints will be multicasted, while WireTap can have only one endpoint to send to.
The wireTap component sends the message to just one route while the main flow continues.
The multicast router sends the message through multiple routes and waits for all of them to continue before the main flow can continue with the next message processor.
In the case of the old and deprecated multicast router, that happens synchronously, meaning that the main flow has to wait for the sum of all the routes execution times.
In 3.5 a new multicasting router called was introduced which does the same thing but in parallel, making the main flow only way for the slowest route.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With