为什么 spring-websocket 中的 STOMP 功能依赖于 Spring MVC?
Why does STOMP functionality in spring-websocket depend on Spring MVC?
目前,我正在尝试使用 webflux 将 STOMP 与 websockets 结合使用。为了向 STOMP 主题发送消息,我需要使用 SimpMessagingTemplate
,这是在我添加 @EnableWebSocketMessageBroker
时由 spring 引导自动配置贡献的
但问题是,@EnableWebSocketMessageBroker
间接期望我在 classpath
中有 spring-mvc
库
@EnableWebSocketMessageBroker
@Import
s DelegatingWebSocketMessageBrokerConfiguration
扩展 WebSocketMessageBrokerConfigurationSupport
& WebSocketMessageBrokerConfigurationSupport#stompWebSocketHandlerMapping
方法期望返回 class HandlerMapping
我的问题是
- 如何在没有 webmvc 的情况下将 STOMP 与 webflux 集成
- 为什么自动配置会强制我们在 classpath 中使用 mvc(并且可能与 webflux 冲突)
如果您在 Google 上搜索 "stomp webflux",第一个搜索结果(对我来说)是 an issue in the Spring Boot issue tracker,它简要说明了它不受支持的原因:
There is a general intent to provide higher-level, messaging support aligned with WebFlux, but there is no specific target release yet. Note that we are researching gRPC
and RSocket support, which are in the same general category.
已在 5.2
行中开始支持 RSocket,所以您可能想看看。
目前,我正在尝试使用 webflux 将 STOMP 与 websockets 结合使用。为了向 STOMP 主题发送消息,我需要使用 SimpMessagingTemplate
,这是在我添加 @EnableWebSocketMessageBroker
但问题是,@EnableWebSocketMessageBroker
间接期望我在 classpath
spring-mvc
库
@EnableWebSocketMessageBroker
@Import
s DelegatingWebSocketMessageBrokerConfiguration
扩展 WebSocketMessageBrokerConfigurationSupport
& WebSocketMessageBrokerConfigurationSupport#stompWebSocketHandlerMapping
方法期望返回 class HandlerMapping
我的问题是
- 如何在没有 webmvc 的情况下将 STOMP 与 webflux 集成
- 为什么自动配置会强制我们在 classpath 中使用 mvc(并且可能与 webflux 冲突)
如果您在 Google 上搜索 "stomp webflux",第一个搜索结果(对我来说)是 an issue in the Spring Boot issue tracker,它简要说明了它不受支持的原因:
There is a general intent to provide higher-level, messaging support aligned with WebFlux, but there is no specific target release yet. Note that we are researching gRPC and RSocket support, which are in the same general category.
已在 5.2
行中开始支持 RSocket,所以您可能想看看。