The wire tap pattern, shown in Figure A.7, 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 Fuse Mediation Router.
Example A.22 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 A.22. ServiceMix EIP Wire Tap
<eip:wire-tap service="test:wireTap" endpoint="endpoint"> <eip:target> <eip:exchange-target service="test:target" /> </eip:target> <eip:inListener> <eip:exchange-target service="test:trace1" /> </eip:inListener> </eip:wire-tap>
Example A.23 shows how to define an equivalent route using Fuse Mediation Router XML configuration.
Example A.23. Fuse Mediation Router Wire Tap Using XML
<route> <from uri="jbi:endpoint:http://progress.com/demos/test/wireTap/endpoint"/> <to uri="jbi:service:http://progress.com/demos/test/trace1"/> <to uri="jbi:service:http://progress.com/demos/test/target"/> </route>
Example A.24 shows how to define an equivalent route using the Fuse Mediation Router Java DSL.
Example A.24. Fuse Mediation Router Wire Tap Using Java DSL
from("jbi:endpoint:http://progress.com/demos/test/wireTap/endpoint") .to("jbi:service:http://progress.com/demos/test/trace1", "jbi:service:http://progress.com/demos/test/target");