Wire Tap

Pattern Catalog

Previous Previous   Next Next

Site HomePatterns HomeTable of Contents

Point-to-Point Channels are often used for Document Messages because they ensure that exactly one consumer will consume each message. However, for testing, monitoring or troubleshooting, it may be useful to be able to inspect all messages that travel across the channel.

How do you inspect messages that travel on a point-to-point channel?

Insert a simple Recipient List into the channel that publishes each incoming message to the main channel and a secondary channel.

The Wire Tap is a fixed Recipient List with two output channels. It consumes messages off the input channel and publishes the unmodified message to both output channels. To insert the Wire Tap into a channel, you need to create an additional channel and change the destination receiver to consume of the second channel. Because the analysis logic is located inside a second component, we can insert a generic Wire Tap into any channel without any danger of modifying the primary channel behavior. This improves reuse and reduces the risk of instrumenting an existing solution.


Related patterns: Message Broker, Message Store, Point-to-Point Channel

Enterprise Integration Patterns

Find the full description of this pattern in:

Enterprise Integration Patterns
Gregor Hohpe and Bobby Woolf
ISBN 0321200683
650 pages

HomePatternsTable of ContentsPrevious Previous   Next Next