Class ImmutableMessageChannelInterceptor
java.lang.Object
org.springframework.messaging.support.ImmutableMessageChannelInterceptor
- All Implemented Interfaces:
ChannelInterceptor
A simpler interceptor that calls
MessageHeaderAccessor.setImmutable()
on the headers of messages passed through the preSend method.
When configured as the last interceptor in a chain, it allows the component sending the message to leave headers mutable for interceptors to modify prior to the message actually being sent and exposed to concurrent access.
- Since:
- 4.1.2
- Author:
- Rossen Stoyanchev
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionMessage<?>
preSend
(Message<?> message, MessageChannel channel) Invoked before the Message is actually sent to the channel.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.springframework.messaging.support.ChannelInterceptor
afterReceiveCompletion, afterSendCompletion, postReceive, postSend, preReceive
-
Constructor Details
-
ImmutableMessageChannelInterceptor
public ImmutableMessageChannelInterceptor()
-
-
Method Details
-
preSend
Description copied from interface:ChannelInterceptor
Invoked before the Message is actually sent to the channel. This allows for modification of the Message if necessary. If this method returnsnull
then the actual send invocation will not occur.- Specified by:
preSend
in interfaceChannelInterceptor
-