sockjs

Where “user” comes from in convertAndSendToUser works in SockJS+Spring Websocket?

余生长醉 提交于 2019-11-28 18:21:26
I would like to understand how convertAndSendToUser works in Spring SockJS+Websocket framework. In client, we would connect as stompClient.connect(login, password, callback()) which will result in connect request with "Stomp credentials" of login and password, that can be seen e.g. if we handle SessionConnectEvent http://www.sergialmar.com/2014/03/detect-websocket-connects-and-disconnects-in-spring-4/ But it remains unclear to me whether this will be the "user" meant in server-side send operation to a queue: simpMessagingTemplate.convertAndSendToUser(username, "/queue/reply", message); The

Spring Websocket and 404 status on connection

拥有回忆 提交于 2019-11-28 10:21:42
In a working Spring MVC 4.0.2 project running under Tomcat 7.0.50, I'm trying to implement Spring Websocket with simple broker and sockjs stomp endpoint, following the official reference . So, in the contextConfigLocation (DistpacherServlet property) I've add a value "websocket-config.xml" which contains: > <websocket:message-broker application-destination-prefix="/app" > > <websocket:stomp-endpoint path="/monitor"> > <websocket:sockjs /> > </websocket:stomp-endpoint> > <websocket:simple-broker prefix="/topic"/> > </websocket:message-broker> In eclipse console (catalina log) when I start

SockJS receive stomp messages from spring websocket out of order

自闭症网瘾萝莉.ら 提交于 2019-11-27 14:09:48
I am trying to streaming time series data using Springframework SimpMessagingTemplate (default Stomp implementation) to broadcast messages to a topic that the SockJS client subscribed to. However, the messages is received out of order. The server is single thread and messages are sent in ascending order by their timestamps. The client somehow received the messages out of the order. I am using the latest release version of both stompjs and springframework (4.1.6 release). Found the root cause of this issue. The messages were sending in "correct" order from the application implementation

How to set up an apache proxy for Meteor/SockJS and WebSocket?

坚强是说给别人听的谎言 提交于 2019-11-27 13:17:39
问题 I have an apache proxy for a meteor app and apache and meteor are on two separate machines. I need it that way as apache has to serve a lot of real websites and it wouldn't be a good idea to install the meteor app on this machine due to its limited resources. However the WebSocket handshake fails with response code 400 "Can upgrade only to websocket" if I try to connect from the outside via the proxy. Everything works fine when I connect from within the LAN directly to the meteor machine.

Path variables in Spring WebSockets @SendTo mapping

两盒软妹~` 提交于 2019-11-27 11:14:11
I have, what I think to be, a very simple Spring WebSocket application. However, I'm trying to use path variables for the subscription as well as the message mapping. I've posted a paraphrased example below. I would expect the @SendTo annotation to return back to the subscribers based on their fleetId . ie, a POST to /fleet/MyFleet/driver/MyDriver should notify subscribers of /fleet/MyFleet , but I'm not seeing this behavior. It's worth noting that subscribing to literal /fleet/{fleetId} works. Is this intended? Am I missing some piece of configuration? Or is this just not how it works? I'm

Where “user” comes from in convertAndSendToUser works in SockJS+Spring Websocket?

倖福魔咒の 提交于 2019-11-27 10:34:37
问题 I would like to understand how convertAndSendToUser works in Spring SockJS+Websocket framework. In client, we would connect as stompClient.connect(login, password, callback()) which will result in connect request with "Stomp credentials" of login and password, that can be seen e.g. if we handle SessionConnectEvent http://www.sergialmar.com/2014/03/detect-websocket-connects-and-disconnects-in-spring-4/ But it remains unclear to me whether this will be the "user" meant in server-side send

WebSocket with Sockjs & Spring 4 but without Stomp

梦想与她 提交于 2019-11-27 02:51:41
Is there a way to use WebSockets with SockJS client and Spring 4 server but not using STOMP? Based on this tutorial from Spring's website, I know how to set up a WebSocket based application using Stomp and Spring 4. On the client side, we have: var socket = new SockJS('/hello'); stompClient = Stomp.over(socket); stompClient.connect({}, function(frame) { setConnected(true); console.log('Connected: ' + frame); stompClient.subscribe('/topic/greetings', function(greeting){ showGreeting(JSON.parse(greeting.body).content); }); }); And on the server side, we have the following in the controller:

Websocket creation using sockjs-client/sockjs in angular2 webapp project

半腔热情 提交于 2019-11-26 23:41:29
问题 I'm using Angular2 webapp project for FRONT-END and Vertex3 for BACK-END. Using Sockjs-client i'm creating websocket (at client side) to create a communication channel between Frontend and Backend. I have installed sockjs-client using npm : npm install sockjs-client When I import sockjs-client in LoginService.ts file : import * as SockJS from 'sockjs-client'; export class LoginService { URL: string = 'http://localhost:8082/eventbus'; sock: SockJS; handlers = {}; private _opened: boolean =

SockJS receive stomp messages from spring websocket out of order

跟風遠走 提交于 2019-11-26 16:32:20
问题 I am trying to streaming time series data using Springframework SimpMessagingTemplate (default Stomp implementation) to broadcast messages to a topic that the SockJS client subscribed to. However, the messages is received out of order. The server is single thread and messages are sent in ascending order by their timestamps. The client somehow received the messages out of the order. I am using the latest release version of both stompjs and springframework (4.1.6 release). 回答1: Found the root

JSON Web Token (JWT) with Spring based SockJS / STOMP Web Socket

心不动则不痛 提交于 2019-11-26 11:55:42
问题 Background I am in the process of setting up a RESTful web application using Spring Boot (1.3.0.BUILD-SNAPSHOT) that includes a STOMP/SockJS WebSocket, which I intend to consume from an iOS app as well as web browsers. I want to use JSON Web Tokens (JWT) to secure the REST requests and the WebSocket interface but I’m having difficulty with the latter. The app is secured with Spring Security:- @Configuration @EnableWebSecurity public class WebSecurityConfiguration extends