The wire tap pattern allows you to route messages to a separate tap location before it is forwarded to the ultimate destination.
The following example shows how to define a wire tap using the EIP service engine. 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 would also need to
define an Out listener (using the eip:outListner element) and a Fault listener (using the eip:faultListener element).
<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>The following table lists attributes of <eip:wire-tap>:
Table 2.24. Attributes for Wire Tap
| Attribute | Type | Description |
|---|---|---|
copyProperties
|
xs:boolean
| Indicates whether message properties from the incoming exchange are copied to
the outgoing (or fault) message exchange. If you set this to false, the
message properties are not copied. The default value, true, copies the
message properties. |
endpoint
|
xs:string
| Name of the endpoint. |
interfaceName
|
xs:QName
| QName of the interface exposed by the endpoint. |
service
|
xs:QName
| QName of the service exposed by the endpoint. |
wsdlResource
|
xs:string
| Spring resource used to load WSDL describing this endpoint (takes precedence over wsdlExchangeTarget). |
The following table lists elements of <eip:wire-tap>:
Table 2.25. Elements for Wire Tap
| Element | Type | Description |
|---|---|---|
faultListener
| exchange-target | Listener destination for fault messages. |
inListener
|
exchange-target
| Listener destination for in messages. |
lockManager
|
spring:bean
| Lock manager to use for this endpoint. If you do not specify one, a default implementation is provided. |
outListener
|
exchange-target
| Listener destination for out messages. |
store
|
spring:bean
| Store to use. If you do not specify one, the active storeFactory creates one. |
storeFactory
|
spring:bean
| Store factory used to create a store. If you do not specify one, a default factory is used, which creates in-memory only stores. |
target
|
exchange-target
| JBI endpoint receiving the exchange. |
timerManager
|
spring:bean
| Timer manager to use for this endpoint. If you do not specify one, a default implementation is used. |
wsdlExchangeTarget
|
exchange-target
| JBI endpoint acting as a WSDL proxy for this endpoint, enabling you to reuse WSDL across multiple endpoints. |