stomp

Is it possible to send binary data with STOMP over WebSockets using Spring-WebSockets?

半腔热情 提交于 2019-11-29 02:07:10
I am able to send and receive JSON with STOMP over WebSockets following spring documentation . However performance is poor at large high rates, so I wish to profile the use of binary messages. Spring-WebSockets 4.0 JavaScript client running in Chrome 35 stomp.js 1.7.1 Sending I send messages using SimpMessageTemplate with the necessary broker relay - see spring documentation @Controller public class DemoBinaryController { @Autowired private SimpMessagingtemplate template @Scheduled(fixedDelay = 5000) public void demo() throws Exception { GenericMessage<byte[]> message = new GenericMessage<byte

Disconnect client session from Spring websocket stomp server

喜欢而已 提交于 2019-11-28 21:21:53
I've searched quite a bit and been unable to find this: Is there a way that a spring websocket stomp server can disconnect a client based on the sessionId (or really based on anything at all)? It seems to me that once a client connects to a server there is nothing that allows the server to disconnect the client. As far as I know the API doesn't provide what you are looking for, on server-side you can only detect disconnect events. If you want to disconnect a certain client I think you must go for a litte workaround, e.g. this one: Write a client-side javascript function that is able to trigger

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

Check auth while sending a message to a specific user by using STOMP and WebSocket in Spring

馋奶兔 提交于 2019-11-28 17:20:26
I'm developing a realtime notification system in Spring 4 by using a build-in Message Broker , and STOMP over WebSocket . I would like to be able to send messages to a specific user, according with his username. In order to achieve this goal, I'm using the convertAndSendToUser method of org.springframework.messaging.simp.SimpMessagingTemplate class, as follows: private final MessagingTemplate messagingTemplate; @Autowired public LRTStatusListener(SimpMessagingTemplate messagingTemplate) { this.messagingTemplate = messagingTemplate; } @Scheduled(fixedDelay=5000) public void sendMessages

Does Spring @SubscribeMapping really subscribe the client to some topic?

爱⌒轻易说出口 提交于 2019-11-28 16:22:47
I am using Spring Websocket with STOMP, Simple Message Broker. In my @Controller I use method-level @SubscribeMapping , which should subscribe the client to a topic so that the client would receive the messages of that topic afterwards. Let say, the client subscribes to the topic "chat" : stompClient.subscribe('/app/chat', ...); As the client subscribed to "/app/chat ", instead of "/topic/chat" , this subscription would go to the method which is mapped using @SubscribeMapping : @SubscribeMapping("/chat") public List getChatInit() { return Chat.getUsers(); } Here is what Spring ref. says: By

Automatic reconnect with Stomp.js in Node.js application

孤街醉人 提交于 2019-11-28 06:58:15
I'm working with an application that is written in Node.js and Express, and I'm trying to use the Stomp.js client to connect to an ActiveMQ server. I can get the application to connect to ActiveMQ just fine using Stomp, but I am unable to get the system to automatically reconnect upon connection failure. It seems like the failure function is only called if the connection is initially successful and then later severed, though if ActiveMQ is already down when the Node app starts, I do see the error message that proves the failure function was called. var Stomp = require('stompjs'); var

Stomp over websocket : The send buffer size exceeded the allowed limit

元气小坏坏 提交于 2019-11-28 03:40:01
问题 At client side I am using Stomp for websocket connection and server side I am using Spring 4 It client side I did configuration as var socket = new SockJS(urlBase + "/" + contextroot+'/hello'); stompClient = Stomp.over(socket); Below code executed for every 2 second to send data to server stompClient.send('/app/sendRequest/'+indexVal, {}, JSON.stringify({index : simIndex})); Server respond to below queue stompClient.subscribe('/queue/response', processResponseObj); at server side

Check auth while sending a message to a specific user by using STOMP and WebSocket in Spring

天大地大妈咪最大 提交于 2019-11-27 20:02:39
问题 I'm developing a realtime notification system in Spring 4 by using a build-in Message Broker , and STOMP over WebSocket . I would like to be able to send messages to a specific user, according with his username. In order to achieve this goal, I'm using the convertAndSendToUser method of org.springframework.messaging.simp.SimpMessagingTemplate class, as follows: private final MessagingTemplate messagingTemplate; @Autowired public LRTStatusListener(SimpMessagingTemplate messagingTemplate) {

Is it possible to send binary data with STOMP over WebSockets using Spring-WebSockets?

青春壹個敷衍的年華 提交于 2019-11-27 16:27:32
问题 I am able to send and receive JSON with STOMP over WebSockets following spring documentation. However performance is poor at large high rates, so I wish to profile the use of binary messages. Spring-WebSockets 4.0 JavaScript client running in Chrome 35 stomp.js 1.7.1 Sending I send messages using SimpMessageTemplate with the necessary broker relay - see spring documentation @Controller public class DemoBinaryController { @Autowired private SimpMessagingtemplate template @Scheduled(fixedDelay

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