spring-framework / org.springframework.messaging.support / ImmutableMessageChannelInterceptor

ImmutableMessageChannelInterceptor

open class ImmutableMessageChannelInterceptor : ChannelInterceptorAdapter

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

Constructors

<init>

ImmutableMessageChannelInterceptor()

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.

Functions

preSend

open fun preSend(message: Message<*>, channel: MessageChannel): Message<*>

Inherited Functions

afterReceiveCompletion

open fun afterReceiveCompletion(message: Message<*>, channel: MessageChannel, ex: Exception): Unit

afterSendCompletion

open fun afterSendCompletion(message: Message<*>, channel: MessageChannel, sent: Boolean, ex: Exception): Unit

postReceive

open fun postReceive(message: Message<*>, channel: MessageChannel): Message<*>

postSend

open fun postSend(message: Message<*>, channel: MessageChannel, sent: Boolean): Unit

preReceive

open fun preReceive(channel: MessageChannel): Boolean