1 <?xml version="1.0" encoding="UTF-8"?>
2 <beans xmlns="http://www.springframework.org/schema/beans"
3 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
4 xmlns:context="http://www.springframework.org/schema/context"
5 xmlns:websocket="http://www.springframework.org/schema/websocket"
7 xsi:schemaLocation="http://www.springframework.org/schema/beans
8 http://www.springframework.org/schema/beans/spring-beans.xsd
9 http://www.springframework.org/schema/context
10 http://www.springframework.org/schema/context/spring-context.xsd
11 http://www.springframework.org/schema/websocket
12 http://www.springframework.org/schema/websocket/spring-websocket.xsd">
15 Searches for beans in packages (instead of XML configuration we can use
16 in this way annotations like @Service, @Endpoint, etc, etc)
18 <context:component-scan base-package="de.spring.stomp"/>
21 <websocket:handlers allowed-origins="*">
22 <websocket:mapping path="/myHandler" handler="sockJsHandler"/>
23 <!-- Using SockJS protocol -->
25 <websocket:handshake-interceptors>
26 <bean class="org.springframework.web.socket.server.support.HttpSessionHandshakeInterceptor"/>
27 </websocket:handshake-interceptors>
30 <bean id="sockJsHandler" class="org.springframework.web.socket.sockjs.transport.handler.SockJsWebSocketHandler"/>
32 <bean class="org.springframework.web.socket.server.standard.ServletServerContainerFactoryBean">
33 <property name="maxTextMessageBufferSize" value="8192"/>
34 <property name="maxBinaryMessageBufferSize" value="8192"/>
39 <websocket:message-broker application-destination-prefix="/app">
40 <websocket:stomp-endpoint path="/portfolio">
42 </websocket:stomp-endpoint>
43 <!-- Full-featured broker, see: http://docs.spring.io/spring/docs/current/spring-framework-reference/html/websocket.html#websocket-stomp-handle-broker-relay -->
44 <websocket:stomp-broker-relay prefix="/topic,/queue" />
45 </websocket:message-broker>