Add ImmutableMessageChannelInterceptor
This change adds a ChannelInterceptor that flips the immutable flag on messages being sent. This allows components sending messages to leave the message mutable for interceptors to further apply modifications before the message is sent (and exposed to concurrency). The interceptor is automatically added with the STOMP/WebSocket Java and XML config and the StompSubProtocolHandler leaves parsed incoming messages mutable so they can be further modified before being sent. Issue: SPR-12321
This commit is contained in:
@@ -111,7 +111,7 @@ public class MessageBrokerConfigurationTests {
|
||||
AbstractSubscribableChannel channel = this.customContext.getBean(
|
||||
"clientInboundChannel", AbstractSubscribableChannel.class);
|
||||
|
||||
assertEquals(2, channel.getInterceptors().size());
|
||||
assertEquals(3, channel.getInterceptors().size());
|
||||
|
||||
CustomThreadPoolTaskExecutor taskExecutor = this.customContext.getBean(
|
||||
"clientInboundChannelExecutor", CustomThreadPoolTaskExecutor.class);
|
||||
@@ -178,7 +178,7 @@ public class MessageBrokerConfigurationTests {
|
||||
AbstractSubscribableChannel channel = this.customContext.getBean(
|
||||
"clientOutboundChannel", AbstractSubscribableChannel.class);
|
||||
|
||||
assertEquals(2, channel.getInterceptors().size());
|
||||
assertEquals(3, channel.getInterceptors().size());
|
||||
|
||||
ThreadPoolTaskExecutor taskExecutor = this.customContext.getBean(
|
||||
"clientOutboundChannelExecutor", ThreadPoolTaskExecutor.class);
|
||||
@@ -257,7 +257,7 @@ public class MessageBrokerConfigurationTests {
|
||||
AbstractSubscribableChannel channel = this.customContext.getBean(
|
||||
"brokerChannel", AbstractSubscribableChannel.class);
|
||||
|
||||
assertEquals(3, channel.getInterceptors().size());
|
||||
assertEquals(4, channel.getInterceptors().size());
|
||||
|
||||
ThreadPoolTaskExecutor taskExecutor = this.customContext.getBean(
|
||||
"brokerChannelExecutor", ThreadPoolTaskExecutor.class);
|
||||
|
||||
Reference in New Issue
Block a user