848ddc9fe436780b46b4faf0daf199ee88680316
[JavaForFun] /
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"
6
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">
13
14     <!--
15         Searches for beans in packages (instead of XML configuration we can use
16         in this way annotations like @Service, @Endpoint, etc, etc)
17     -->
18     <context:component-scan base-package="de.spring.stomp"/>
19
20
21     <bean class="org.springframework.web.socket.server.standard.ServletServerContainerFactoryBean">
22         <property name="maxTextMessageBufferSize" value="8192"/>
23         <property name="maxBinaryMessageBufferSize" value="8192"/>
24     </bean>
25     
26     <!-- STOMP -->
27     <websocket:message-broker application-destination-prefix="/app">
28         <websocket:stomp-endpoint path="/portfolio" allowed-origins="*">
29             <websocket:sockjs/>
30         </websocket:stomp-endpoint>
31         <!--
32                 Full-featured broker, see: http://docs.spring.io/spring/docs/current/spring-framework-reference/html/websocket.html#websocket-stomp-handle-broker-relay
33         <websocket:stomp-broker-relay prefix="/topic,/queue" />
34         -->
35         <websocket:simple-broker prefix="/topic, /queue"/>
36     </websocket:message-broker>
37
38 </beans>