Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/ant/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Websocket 如何在XML上设置StompSubtocolHandler?_Websocket_Spring Websocket - Fatal编程技术网

Websocket 如何在XML上设置StompSubtocolHandler?

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中设置

我的问题是我不知道如何将stompsubtocolhandler设置为XML

我尝试了解普通的websocket集合

<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>