LibraryToggle FramesPrintFeedback

Wire Tap


The wire tap pattern, shown in Figure 54, allows you to route messages to a separate tap location before it is forwarded to the ultimate destination. The ServiceMix EIP wire tap pattern maps to the wire tap pattern in Apache Camel.

Figure 54. Wire Tap Pattern

Wire tap pattern

Example ServiceMix EIP route

Example 35 shows how to define a wire tap using the ServiceMix EIP component. The In message from the source endpoint is copied to the In-listener endpoint, before being forwarded on to the target endpoint. If you want to monitor any returned Out messages or Fault messages from the target endpoint, you also must define an Out listener (using the eip:outListner element) and a Fault listener (using the eip:faultListener element).

Example 35. ServiceMix EIP Wire Tap

<eip:wire-tap service="test:wireTap" endpoint="endpoint">
    <eip:exchange-target service="test:target" />
    <eip:exchange-target service="test:trace1" />

Equivalent Apache Camel XML route

Example 36 shows how to define an equivalent route using Apache Camel XML configuration.

Example 36. Apache Camel Wire Tap Using XML

  <from uri="jbi:endpoint:"/>
  <to uri="jbi:service:"/>
  <to uri="jbi:service:"/>

Equivalent Apache Camel Java DSL route

Example 37 shows how to define an equivalent route using the Apache Camel Java DSL.

Example 37. Apache Camel Wire Tap Using Java DSL


Comments powered by Disqus