I need to install an application on a non JEE7 compliant server. I am using Spring + Stomp + SocksJs for realtime notifications.
My code looks like this:
@Configuration
@EnableWebSocketMessageBroker
public class WebSocketConfig extends AbstractWebSocketMessageBrokerConfigurer {
@Override
public void configureMessageBroker(MessageBrokerRegistry config) {
config.enableSimpleBroker("/topic");
config.setApplicationDestinationPrefixes("/app");
}
@Override
public void registerStompEndpoints(StompEndpointRegistry ser) {
ser.addEndpoint("/notifications").withSockJS()
}
}
}
And on the client:
function setSocket(broker, callbackFn) {
var socket = {};
socket.cliente = new SockJS(path + broker);
socket.stomp = Stomp.over(socket.cliente);
socket.stomp.connect({}, function () {
socket.stomp.subscribe("/topic" + broker, callbackFn);
});
}
Is there any way to manually set the transport type to use and avoid the use of websockets?