|
@@ -5,6 +5,7 @@ import cn.iocoder.yudao.framework.mq.redis.core.RedisMQTemplate;
|
|
|
import cn.iocoder.yudao.framework.websocket.core.handler.JsonWebSocketMessageHandler;
|
|
|
import cn.iocoder.yudao.framework.websocket.core.listener.WebSocketMessageListener;
|
|
|
import cn.iocoder.yudao.framework.websocket.core.security.LoginUserHandshakeInterceptor;
|
|
|
+import cn.iocoder.yudao.framework.websocket.core.security.WebSocketAuthorizeRequestsCustomizer;
|
|
|
import cn.iocoder.yudao.framework.websocket.core.sender.kafka.KafkaWebSocketMessageConsumer;
|
|
|
import cn.iocoder.yudao.framework.websocket.core.sender.kafka.KafkaWebSocketMessageSender;
|
|
|
import cn.iocoder.yudao.framework.websocket.core.sender.local.LocalWebSocketMessageSender;
|
|
@@ -76,10 +77,15 @@ public class YudaoWebSocketAutoConfiguration {
|
|
|
return new WebSocketSessionManagerImpl();
|
|
|
}
|
|
|
|
|
|
+ @Bean
|
|
|
+ public WebSocketAuthorizeRequestsCustomizer webSocketAuthorizeRequestsCustomizer(WebSocketProperties webSocketProperties) {
|
|
|
+ return new WebSocketAuthorizeRequestsCustomizer(webSocketProperties);
|
|
|
+ }
|
|
|
+
|
|
|
// ==================== Sender 相关 ====================
|
|
|
|
|
|
@Configuration
|
|
|
- @ConditionalOnProperty(prefix = "yudao.websocket", name = "sender-type", havingValue = "local", matchIfMissing = true)
|
|
|
+ @ConditionalOnProperty(prefix = "yudao.websocket", name = "sender-type", havingValue = "local")
|
|
|
public class LocalWebSocketMessageSenderConfiguration {
|
|
|
|
|
|
@Bean
|
|
@@ -90,7 +96,7 @@ public class YudaoWebSocketAutoConfiguration {
|
|
|
}
|
|
|
|
|
|
@Configuration
|
|
|
- @ConditionalOnProperty(prefix = "yudao.websocket", name = "sender-type", havingValue = "redis", matchIfMissing = true)
|
|
|
+ @ConditionalOnProperty(prefix = "yudao.websocket", name = "sender-type", havingValue = "redis")
|
|
|
public class RedisWebSocketMessageSenderConfiguration {
|
|
|
|
|
|
@Bean
|
|
@@ -108,7 +114,7 @@ public class YudaoWebSocketAutoConfiguration {
|
|
|
}
|
|
|
|
|
|
@Configuration
|
|
|
- @ConditionalOnProperty(prefix = "yudao.websocket", name = "sender-type", havingValue = "rocketmq", matchIfMissing = true)
|
|
|
+ @ConditionalOnProperty(prefix = "yudao.websocket", name = "sender-type", havingValue = "rocketmq")
|
|
|
public class RocketMQWebSocketMessageSenderConfiguration {
|
|
|
|
|
|
@Bean
|
|
@@ -127,7 +133,7 @@ public class YudaoWebSocketAutoConfiguration {
|
|
|
}
|
|
|
|
|
|
@Configuration
|
|
|
- @ConditionalOnProperty(prefix = "yudao.websocket", name = "sender-type", havingValue = "rabbitmq", matchIfMissing = true)
|
|
|
+ @ConditionalOnProperty(prefix = "yudao.websocket", name = "sender-type", havingValue = "rabbitmq")
|
|
|
public class RabbitMQWebSocketMessageSenderConfiguration {
|
|
|
|
|
|
@Bean
|
|
@@ -156,7 +162,7 @@ public class YudaoWebSocketAutoConfiguration {
|
|
|
}
|
|
|
|
|
|
@Configuration
|
|
|
- @ConditionalOnProperty(prefix = "yudao.websocket", name = "sender-type", havingValue = "kafka", matchIfMissing = true)
|
|
|
+ @ConditionalOnProperty(prefix = "yudao.websocket", name = "sender-type", havingValue = "kafka")
|
|
|
public class KafkaWebSocketMessageSenderConfiguration {
|
|
|
|
|
|
@Bean
|