@ManagedResource @IntegrationManagedResource public class WireTap extends ChannelInterceptorAdapter implements Lifecycle, VetoCapableInterceptor
ChannelInterceptor that publishes a copy of the intercepted message
to a secondary target while still sending the original message to the main channel.| Constructor and Description |
|---|
WireTap(MessageChannel channel)
Create a new wire tap with no
MessageSelector. |
WireTap(MessageChannel channel,
MessageSelector selector)
Create a new wire tap with the provided
MessageSelector. |
| Modifier and Type | Method and Description |
|---|---|
boolean |
isRunning()
Check whether the wire tap is currently running.
|
Message<?> |
preSend(Message<?> message,
MessageChannel channel)
Intercept the Message and, if accepted by the
MessageSelector,
send it to the secondary target. |
void |
setTimeout(long timeout)
Specify the timeout value for sending to the intercepting target.
|
boolean |
shouldIntercept(String beanName,
ChannelInterceptorAware channel) |
void |
start()
Restart the wire tap if it has been stopped.
|
void |
stop()
Stop the wire tap.
|
afterReceiveCompletion, afterSendCompletion, postReceive, postSend, preReceivepublic WireTap(MessageChannel channel)
MessageSelector.channel - the MessageChannel to which intercepted messages will be sentpublic WireTap(MessageChannel channel, MessageSelector selector)
MessageSelector.channel - the channel to which intercepted messages will be sentselector - the selector that must accept a message for it to be
sent to the intercepting channelpublic void setTimeout(long timeout)
timeout - the timeout in milliseconds@ManagedAttribute public boolean isRunning()
@ManagedOperation public void start()
@ManagedOperation public void stop()
start().public Message<?> preSend(Message<?> message, MessageChannel channel)
MessageSelector,
send it to the secondary target. If this wire tap's MessageSelector is
null, it will accept all messages.preSend in interface ChannelInterceptorpreSend in class ChannelInterceptorAdapterpublic boolean shouldIntercept(String beanName, ChannelInterceptorAware channel)
shouldIntercept in interface VetoCapableInterceptorbeanName - The channel name.channel - The channel that is about to be intercepted.