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 32 describes the properties you can specify using the properties editor.

Table 32. Wire Tap Properties

NameDescription
UriSpecifies the URI of the endpoint to which the copy is routed. See Components Overview for a list of valid URI patterns.
LanguageSpecifies the expression language used to process the expression.
Cache SizeSets the maximum size used by the org.apache.camel.impl.ConsumerCache, which is used to cache and reuse producers.
CopySpecifies whether the original message is copied into the new message. The default is Enabled.
DescriptionSpecifies 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.
Executor Service RefSpecifies a reference for looking up the executorService to use for thread pool management.
Id

Specifies a unique identifier for the endpoint.

The tooling automatically generates an id for a node when it is created, but you can remove that id or replace it with your own. The Camel debugger requires all nodes with a breakpoint set to have a unique id.

You can use the id to refer to endpoints in your Camel XML file.

Ignore Invalid EndpointIgnore the InvalidEndpointException when trying to create a producer with that endpoint.
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.

PatternSets the optional ExchangePattern used to invoke this endpoint.
Processor RefSpecifies 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.

Related topics

Expression and Predicates Languages
Configuring the route editor