Skip to content

Commit ceb79c9

Browse files
committed
Use InterceptableChannel in AbstractBrokerMessageHandler
Issue: SPR-12218
1 parent 6f1ab8d commit ceb79c9

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

spring-messaging/src/main/java/org/springframework/messaging/simp/broker/AbstractBrokerMessageHandler.java

+5-5
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,9 @@
3232
import org.springframework.messaging.SubscribableChannel;
3333
import org.springframework.messaging.simp.SimpMessageHeaderAccessor;
3434
import org.springframework.messaging.simp.SimpMessageType;
35-
import org.springframework.messaging.support.AbstractMessageChannel;
3635
import org.springframework.messaging.support.ChannelInterceptor;
3736
import org.springframework.messaging.support.ChannelInterceptorAdapter;
37+
import org.springframework.messaging.support.InterceptableChannel;
3838
import org.springframework.util.Assert;
3939
import org.springframework.util.CollectionUtils;
4040

@@ -172,8 +172,8 @@ public void start() {
172172
}
173173
this.clientInboundChannel.subscribe(this);
174174
this.brokerChannel.subscribe(this);
175-
if (this.clientInboundChannel instanceof AbstractMessageChannel) {
176-
((AbstractMessageChannel) this.clientInboundChannel).addInterceptor(0, this.unsentDisconnectInterceptor);
175+
if (this.clientInboundChannel instanceof InterceptableChannel) {
176+
((InterceptableChannel) this.clientInboundChannel).addInterceptor(0, this.unsentDisconnectInterceptor);
177177
}
178178
startInternal();
179179
this.running = true;
@@ -195,8 +195,8 @@ public void stop() {
195195
stopInternal();
196196
this.clientInboundChannel.unsubscribe(this);
197197
this.brokerChannel.unsubscribe(this);
198-
if (this.clientInboundChannel instanceof AbstractMessageChannel) {
199-
((AbstractMessageChannel) this.clientInboundChannel).removeInterceptor(this.unsentDisconnectInterceptor);
198+
if (this.clientInboundChannel instanceof InterceptableChannel) {
199+
((InterceptableChannel) this.clientInboundChannel).removeInterceptor(this.unsentDisconnectInterceptor);
200200
}
201201
this.running = false;
202202
if (logger.isDebugEnabled()) {

0 commit comments

Comments
 (0)