LibraryLink ToToggle FramesPrintFeedback

Wire Tap

The wire tap pattern enables you to monitor the messages passing through a channel by duplicating the message stream: one copy of the stream is forwarded to the main channel and another copy of the stream is forwarded to the tap endpoint, which monitors the stream.


The following example shows how to route a request from an input queue:a endpoint to the wire tap location queue:tap before it is received by queue:b.

RouteBuilder builder = new RouteBuilder() {
    public void configure() {
        from("seda:a").to("seda:tap", "seda:b");
    }
};

The following example shows how to configure the same route in XML:

<camelContext id="buildWireTap" xmlns="http://activemq.apache.org/camel/schema/spring">
  <route>
    <from uri="seda:a"/>
    <to uri="seda:tap"/>
    <to uri="seda:b"/>
  </route>
</camelContext>