【发布时间】:2019-08-28 06:22:05
【问题描述】:
目前,我正在尝试将 STOMP 与使用 webflux 的 websocket 一起使用。为了向STOMP主题发送消息,我需要使用SimpMessagingTemplate,这是我添加@EnableWebSocketMessageBroker时由spring boot自动配置贡献的
但问题是,@EnableWebSocketMessageBroker 间接希望我在类路径中有 spring-mvc 库
@EnableWebSocketMessageBroker @Imports DelegatingWebSocketMessageBrokerConfiguration 扩展 WebSocketMessageBrokerConfigurationSupport & WebSocketMessageBrokerConfigurationSupport#stompWebSocketHandlerMapping 方法期望返回类 HandlerMapping
我的问题是
- 如何在没有 webmvc 的情况下将 STOMP 与 webflux 集成
- 为什么自动配置会强制我们在类路径中使用 mvc(并可能与 webflux 冲突)
【问题讨论】:
标签: spring-webflux spring-websocket stomp spring-messaging