如何在XML上设置StompSubProtocolHandler?

时间:2017-03-09 15:58:52

标签: websocket spring-websocket

我的问题是我不知道如何在XML上设置StompSubProtocolHandler

我尝试了解正常的websocket set

<websocket:handlers allowed-origins="*">
         <websocket:mapping path="/raphaServerHandler.do" handler="raphaServerHandler"/>
   </websocket:handlers>

但我需要知道在XML上设置StompSubProtocolHandler!

1 个答案:

答案 0 :(得分:0)

由以下内容自动完成:

<websocket:message-broker application-destination-prefix="/app">
    <websocket:stomp-endpoint path="/foo" />
    <websocket:simple-broker prefix="/topic" />
</websocket:message-broker>
<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>

http://docs.spring.io/spring/docs/current/spring-framework-reference/html/websocket.html#websocket-stomp-enable