use of org.springframework.web.socket.messaging.WebSocketStompClient in project yaps-client by serdaroquai.
the class WebsocketConfig method webSocketClient.
@Bean
public WebSocketStompClient webSocketClient(TaskScheduler taskScheduler) {
List<Transport> transports = new ArrayList<Transport>();
transports.add(new WebSocketTransport(new StandardWebSocketClient()));
WebSocketClient transport = new SockJsClient(transports);
WebSocketStompClient stompClient = new WebSocketStompClient(transport);
stompClient.setMessageConverter(new MappingJackson2MessageConverter());
// for heartbeats
stompClient.setTaskScheduler(taskScheduler);
return stompClient;
}
Aggregations