ImmutableMessageChannelInterceptor

A simpler interceptor that calls {@link MessageHeaderAccessor#setImmutable()} on the headers of messages passed through the preSend method.

<p>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

Members

Functions

preSend
MessageBase preSend(MessageBase message, MessageChannel channel)
Undocumented in source. Be warned that the author may not have intended to support it.

Inherited Members

From ChannelInterceptor

preSend
MessageBase preSend(MessageBase message, MessageChannel channel)

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

postSend
void postSend(MessageBase message, MessageChannel channel, bool sent)

Invoked immediately after the send invocation. The value argument represents the return value of that invocation.

afterSendCompletion
void afterSendCompletion(MessageBase message, MessageChannel channel, bool sent, Exception ex)

Invoked after the completion of a send regardless of any exception that have been raised thus allowing for proper resource cleanup. <p>Note that this will be invoked only if {@link #preSend} successfully completed and returned a Message, i.e. it did not return {@code null}. @since 4.1

preReceive
bool preReceive(MessageChannel channel)

Invoked as soon as receive is called and before a Message is actually retrieved. If the return value is 'false', then no Message will be retrieved. This only applies to PollableChannels.

postReceive
MessageBase postReceive(MessageBase message, MessageChannel channel)

Invoked immediately after a Message has been retrieved but before it is returned to the caller. The Message may be modified if necessary; {@code null} aborts further interceptor invocations. This only applies to PollableChannels.

afterReceiveCompletion
void afterReceiveCompletion(MessageBase message, MessageChannel channel, Exception ex)

Invoked after the completion of a receive regardless of any exception that have been raised thus allowing for proper resource cleanup. <p>Note that this will be invoked only if {@link #preReceive} successfully completed and returned {@code true}. @since 4.1

Meta