Websocket 如何在XML上设置StompSubtocolHandler?
我的问题是我不知道如何将stompsubtocolhandler设置为XML 我尝试了解普通的websocket集合Websocket 如何在XML上设置StompSubtocolHandler?,websocket,spring-websocket,Websocket,Spring Websocket,我的问题是我不知道如何将stompsubtocolhandler设置为XML 我尝试了解普通的websocket集合 <websocket:handlers allowed-origins="*"> <websocket:mapping path="/raphaServerHandler.do" handler="raphaServerHandler"/> </websocket:handlers> 但我需要知道如何在XML中设置
<websocket:handlers allowed-origins="*">
<websocket:mapping path="/raphaServerHandler.do" handler="raphaServerHandler"/>
</websocket:handlers>
但我需要知道如何在XML中设置StompSubtocolHandler 由以下程序自动完成:
<websocket:message-broker application-destination-prefix="/app">
<websocket:stomp-endpoint path="/foo" />
<websocket:simple-broker prefix="/topic" />
</websocket:message-broker>
我知道设置套接字Stomp,但您的示例代码需要contoller和MessageMapping,但stompSubtocol没有MessageMapping不确定
@MessageMapping
与您的问题有何关联。stompsubtocolhandler
填充在MessageBrokerBeanDefinitionParser
中。然后,@MessageMapping
会自动完成。啊。。。很抱歉谢谢你。事实上,我不知道频道和websocket的内外界概念。。你有什么样的代码吗?关于StompSubtocol?尝试调查此应用程序:Hi@ArtemBilan你能看看我的类似问题吗:
<xsd:documentation><![CDATA[
Configures broker-backed messaging over WebSocket using a higher-level messaging sub-protocol.
Registers a SimpleUrlHandlerMapping and maps paths to registered Controllers.
A StompSubProtocolHandler is registered to handle various versions of the STOMP protocol.
See EnableWebSocketMessageBroker javadoc for information on code-based alternatives to enabling broker-backed messaging.
]]></xsd:documentation>