## Name

Wire Tap — Routes a copy of a message to a secondary destination while passing the original message to the actual recipient, or it creates a new message and passes that to the recipient.

## Usage

The Wire Tap pattern has two modes of operation:

- Tap mode—makes a shallow copy of the message exchange and directs the copy to a secondary location. The original exchange continues to the next step in the route.

- New message mode—creates a new message exchange by setting the message body and setting one or more message headers. The new exchange is passed to the next step in the route.

The Wire Tap pattern can be placed anywhere in the route body.

## Properties

Table 31 describes the properties you can specify using the properties editor.

Table 31. Wire Tap Properties

Name | Description
--- | ---
New Exchange Expression | Specifies the expression used to determine the contents of the new message exchange.
language | Specifies the expression language used to process the expression.
Uri | Specifies the URI of the endpoint to which the copy is routed. See Table of Components for a list of valid URI patterns.
Inherit Error Handler | Specifies whether the node should use the error handler configured for the route. The default is `Disabled`.
New Exchange Processor Ref | Specifies a reference to a bean implementing a message processor to process the original message before it is passed to the next step in the route.
Copy | Specifies whether the original message is copied into the new message. The default is `Enabled`.
On Prepare Ref | Specifies a reference to a bean implementing a custom `onPrepare` processor that processes the original message before it is passed to the next step in the route. This property enables you to deep clone mutable message bodies, preserving an entire exchange as a separate entity. You can use this property to execute any kind of logic on a message exchange.
Executor Service Ref | Specifies a reference for looking up the `executorService` to use for thread pool management.
Headers | Specifies one or more header settings for a new message. The Add button opens a dialog for adding a header to the table. Header—Specifies the name of the header Expression—Specifies the value, as an expression, assigned to the header Language—Specifies the language to use to process the expression The Edit button opens the selected header for editing. The Delete button removes the selected header from the table.
Id | Specifies a unique identifier for the endpoint. The Id can be used to refer to the endpoint in the Camel XML file.
Description | Specifies a text description for the node. This description is included in the generated XML file, but it is informational only. It is not used by Apache Camel.

## Related topics

Expression and Predicates Languages
Configuring the route editor