I use client-server application with WebSocket communication. On the server, I use the SimpMessagingTemplate spring:
Map<String, String> ackHeader = new HashMap<String, String>(); ackHeader.put("id", ""+System.nanoTime()); Map<String, Object> ackHeaders = new HashMap<String, Object>(); ackHeaders.put(StompHeaderAccessor.STOMP_ACK_HEADER, ackHeader); template.convertAndSend(clientDestination, ьуыыфпу, ackHeaders); My WebSocketConfig:
@Override public void configureMessageBroker(MessageBrokerRegistry config) { config.enableSimpleBroker("/client"); config.setApplicationDestinationPrefixes("/app"); } @Override public void registerStompEndpoints(StompEndpointRegistry registry) { registry.addEndpoint("/endpoint").withSockJS(); } If the client has closed the browser, how can I understand this when calling the convertAndSend method or some other way - can a handler hang, the question is how and where?