spring-websocket

not connecting to spring websocket server

别来无恙 提交于 2019-12-11 15:24:18
问题 It is not connecting to the websocket server.I am using webstomp-client for react native.Plz, help me ! Here is my code, componentWillMount() { let msg = ''; const options = { debug: true, protocols: webstomp.VERSIONS.supportedProtocols() } this.stompClient = webstomp.client("ws://192.168.3.167:8080/test", options) this.stompClient.connect({}, (frame) => { console.log("OK") this.stompClient.subscribe('/topic/greetings', (greeting) => { msg = JSON.parse(greeting.body); }); this.setState({

Spring websocket - sendToUser from a cluster does not work from backup server

谁说我不能喝 提交于 2019-12-11 13:40:48
问题 We have a spring mvc with spring websocket configured ('spring-websocket', version:'4.1.0.RELEASE'). We have a simple class that executes the following code: @Autowired private SimpMessagingTemplate template; @Override public void push(Long userId, Object message, WebsocketQueue queue) { String loginName = this.userRepository.getLoginName(userId); this.template.convertAndSendToUser( loginName, queue.getMapping(), message); } This works great with a single tomcat (non clustered environment)

Spring websocket in existing project- not working

北城以北 提交于 2019-12-11 13:27:24
问题 I have an existing project in Spring MVC which works as expected without any issues. Iam able to take view pages via controller. Now i configure spring websocket into this existing project using below code @Configuration @EnableWebSocketMessageBroker public class WebSocketConfig extends AbstractWebSocketMessageBrokerConfigurer { @Override public void configureMessageBroker(MessageBrokerRegistry config) { config.enableSimpleBroker("/topic"); config.setApplicationDestinationPrefixes("/app"); }

Getting a Failed to start bean 'subProtocolWebSocketHandler' exception while trying to implement websockets

て烟熏妆下的殇ゞ 提交于 2019-12-11 13:27:21
问题 I am going through the websockets with Spring 4 tutorial here. I have it working where the server responds when client calls. However, my use case is having the server push the messages without client having to call. So I looked up online on ways to do that and came across a few posts that said that I needed to use something called SimpMessagingTemplate . So I changed the code to use the SimpMessagingTemplate . Now I get this exception in the server console: 04-Jun-2016 22:49:24.093 SEVERE

Spring integration connecting inbound HTTP gateway with outbound Websocket gateaway

眉间皱痕 提交于 2019-12-11 11:56:48
问题 I want to create a REST service to turn on the light. The architecture that I want to have is the following: Many embedded system each is connected to one light instance Each embedded system has a websocket client, that connects to my server My server holds a REST service that allows webclients to choose one light instance, and turn it on The REST service would have a parameter to specify a reference for one light instance, connected to the system and send the message to websocket client,

WebSocketMessageBrokerConfigurer

↘锁芯ラ 提交于 2019-12-11 07:41:53
问题 public abstract class AbstractSessionWebSocketMessageBrokerConfigurer<S extends ExpiringSession> extends AbstractWebSocketMessageBrokerConfigurer { @Override public void configureWebSocketTransport(WebSocketTransportRegistration registration) { registration.addDecoratorFactory(wsConnectHandlerDecoratorFactory()); } static class SessionStompEndpointRegistry implements StompEndpointRegistry { private final StompEndpointRegistry registry; private final HandshakeInterceptor interceptor; public

Spring Websocket Server Resets Connection When Sending Large Amounts of Data

∥☆過路亽.° 提交于 2019-12-11 07:08:46
问题 I'm having issues where while trying to send data from a Spring Websocket Server (hosted on Tomcat) it seems to reset the connection in the middle of trying to send the message. The error seems happen more when sending large amounts of binary data (5526584 bytes in the example here), but I've seen it happen on the text channel and with less data as well. However sending more then 5 or so MB seems to crash it relatively consistently. Edit - The below the end edit block is the server side code

SockJS not passing credential information when on a different domain(CORS)

ε祈祈猫儿з 提交于 2019-12-11 06:24:51
问题 We have a websocket server side implementation using spring 4. It has been configured to use spring security for auth/authz. On the client side, we use sockJS which works perfectly when the client is in the same domain as the server. Call to websocket is made this way… socket = new SockJS("http://guest:guest@mydomain.org/MyWebSocketApp/tracker") This eventually makes a call to http://guest:guest@myinterestingdomain.org/MyWebSocketApp/tracker/info to decide the transport to use. All this is

spring websocket with digest authentication

社会主义新天地 提交于 2019-12-11 06:08:00
问题 I use Spring security to authenticate my spring websocket server. It works fine with the Basic authentication , but it went wrong when I changed to Digest authentication . I don't know what to put into the headers. Does someone know any solutions? This is the websocket client code snippet: SockJsClient sockJsClient; WebSocketStompClient stompClient; List<Transport> transports = new ArrayList<>(); final WebSocketHttpHeaders headers = new WebSocketHttpHeaders(); headers.add("Authorization",

How to create a custom source app for spring-cloud-stream-app-starters project

╄→гoц情女王★ 提交于 2019-12-11 04:06:09
问题 I want to create a web-socket source (for spring-cloud-stream-app-starters ) which is currently not available on git hub. I went through some of the available sources but had some confusions, may be because I'm not familiar with the framework. Can I just create a spring boot application with Source binding and return the received packets from web-socket clients in an @InboundChannelAdapter(value = Source.OUTPUT) annotated method. ? Also how can I use WebSocketInboundChannelAdapter to start a