STOMP: Add heart-beat tracing

This commit is contained in:
Artem Bilan
2015-10-14 10:08:08 -04:00
parent 5c4b817e27
commit 0387ab5e7b
3 changed files with 6 additions and 1 deletions

View File

@@ -0,0 +1,2 @@
logging.level.org.springframework.web.socket.sockjs.transport.session=trace
server.session.timeout=60

View File

@@ -39,7 +39,7 @@
<bean id="stompSubProtocolHandler" class="org.springframework.web.socket.messaging.StompSubProtocolHandler"/>
<int-websocket:server-container id="serverWebSocketContainer" path="/chat">
<int-websocket:sockjs/>
<int-websocket:sockjs heartbeat-time="10000"/>
</int-websocket:server-container>
<int-event:inbound-channel-adapter event-types="org.springframework.web.socket.messaging.AbstractSubProtocolEvent"

View File

@@ -12,6 +12,9 @@
if (userValue.value != "") {
currentUser = userValue.value;
sock = new SockJS('http://localhost:8080/chat');
sock.onheartbeat = function() {
console.log('heartbeat');
};
stompClient = Stomp.over(sock);
stompClient.connect({login: currentUser}, function (frame) {
document.getElementById("welcome").style.display = "none";