STOMP: Add heart-beat tracing
This commit is contained in:
@@ -0,0 +1,2 @@
|
||||
logging.level.org.springframework.web.socket.sockjs.transport.session=trace
|
||||
server.session.timeout=60
|
||||
@@ -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"
|
||||
|
||||
@@ -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";
|
||||
|
||||
Reference in New Issue
Block a user