MuleESB / Apache Camel Interview Questions
How does the Wire Tap EIP work and what is it used for?
The Wire Tap sends a copy of the current message to a secondary endpoint asynchronously while allowing the original message to continue through the route unchanged. It is used for auditing, logging to an append-only store, event sourcing side-channels, and monitoring without adding latency to the main processing path.
from("jms:queue:orders")
.wireTap("jms:topic:audit-log") // async copy to audit log
.to("direct:process-order"); // main flow continues
// Wire tap with body transformation for the copy:
from("direct:payment")
.wireTap("jms:queue:payment-audit")
.newExchangeBody(simple("Order ${header.orderId} received at ${date:now:yyyy-MM-dd}"))
.to("direct:process-payment");The wire tap sends a shallow copy of the Exchange with a new thread from the routing thread pool. The original Exchange continues immediately — there is no waiting for the tap. In Camel 3.x the tap always uses InOnly semantics; any response from the tap endpoint is discarded. The tap copy shares message headers with the original by default; use newExchangeBody() or onPrepare() to customise the tap message.
Invest now in Acorns!!! 🚀
Join Acorns and get your $5 bonus!
Acorns is a micro-investing app that automatically invests your "spare change" from daily purchases into diversified, expert-built portfolios of ETFs. It is designed for beginners, allowing you to start investing with as little as $5. The service automates saving and investing. Disclosure: I may receive a referral bonus.
Invest now!!! Get Free equity stock (US, UK only)!
Use Robinhood app to invest in stocks. It is safe and secure. Use the Referral link to claim your free stock when you sign up!.
The Robinhood app makes it easy to trade stocks, crypto and more.
Webull! Receive free stock by signing up using the link: Webull signup.
More Related questions...
