Top Description Constructors Methods
org.springframework.messaging.support

public Class ImmutableMessageChannelInterceptor

extends Object
implements ChannelInterceptor
Class Inheritance
All Implemented Interfaces
org.springframework.messaging.support.ChannelInterceptor
Imports
org.springframework.messaging.Message, .MessageChannel

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.

Author
Rossen Stoyanchev
Since
4.1.2

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public Message<?>
preSend(Message<?> message, MessageChannel channel)

Overrides default org.springframework.messaging.support.ChannelInterceptor.preSend.

Invoked before the Message is actually sent to the channel.
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Constructor Detail

ImmutableMessageChannelInterceptorback to summary
public ImmutableMessageChannelInterceptor()

Method Detail

preSendback to summary
public Message<?> preSend(Message<?> message, MessageChannel channel)

Overrides default org.springframework.messaging.support.ChannelInterceptor.preSend.

Doc from org.springframework.messaging.support.ChannelInterceptor.preSend.

Invoked before the Message is actually sent to the channel. This allows for modification of the Message if necessary. If this method returns null then the actual send invocation will not occur.

Annotations
@Override