stomp

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

一世执手 提交于 2019-12-20 08:29:15
问题 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 :

How update WildFly 10.1.0Final Apache Artemis 1.1.0 to Apache Artemis 1.3

两盒软妹~` 提交于 2019-12-19 10:45:10
问题 I have installed WildFly 10.1.0.Final I I created a Stomp over Websocket client to in Javascript to connect directly to a topic in Artemis. I connect an subscrite two clients but when I close or unscribe one of the two clients, the others spot recive messages. I found a mail-list that have exactly discribing the same problem. http://activemq.2283324.n4.nabble.com/STOMP-server-quits-sending-to-all-subscribers-when-one-client-disconnects-td4713980.html One user called "johndament" mention that

Sending Error message in Spring websockets

你说的曾经没有我的故事 提交于 2019-12-18 17:26:14
问题 I am trying to send error messages in Spring websockets with STOMP over SockJS. I am basically trying to achieve which is being done here. This is my Exception Handler @MessageExceptionHandler @SendToUser(value = "/queue/error",broadcast = false) public ApplicationError handleException(Exception message) throws ApplicationError { return new ApplicationError("test"); } And I am subscribing to stompClient.subscribe('/user/queue/error', stompErrorCallback, {token: accessToken}); User in my case

Stomp over socket using sockjs can't connect with Spring 4 WebSocket

大城市里の小女人 提交于 2019-12-17 19:44:49
问题 Trying to use Spring 4 WebSocket with STOMP over socket using sockjs. And i faced a problem. My configuration: websocket.xml - part of spring context <websocket:message-broker application-destination-prefix="/app"> <websocket:stomp-endpoint path="/ws"> <websocket:sockjs/> </websocket:stomp-endpoint> <websocket:simple-broker prefix="/topic"/> </websocket:message-broker> Controller code: @MessageMapping("/ws") @SendTo("/topic/ws") public AjaxResponse hello() throws Exception { AjaxResponse

Path variables in Spring WebSockets @SendTo mapping

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-17 08:20:18
问题 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}

What solution should I use for this webapp with websockets. ActiveMQ?

大憨熊 提交于 2019-12-13 15:25:43
问题 I'm currently in the middle of developing a webapplication which needs a websocket connection to receive notifications of events from the server. The clients are separated in groups and all the clients in a group must receive the same event notifications. I thought that ActiveMQ could probably support this model, using different queues for each group of clients. It would also be relatively easy to push events to ActiveMQ using stomp, and then use stomp-over-websockets for the clients. The

Spring WebSocket is not send queue-suffix after connection

匆匆过客 提交于 2019-12-13 00:42:58
问题 My server side config is here: <websocket:message-broker application-destination-prefix="/chat"> <websocket:stomp-endpoint path="/connect"> <websocket:sockjs/> </websocket:stomp-endpoint> <websocket:simple-broker prefix="/broadcast/"/> </websocket:message-broker> Client side code: var stompClient = null; var socket = new SockJS('/connect'); stompClient = Stomp.over(socket); stompClient.connect('', '', function (frame) { console.log(frame); // Inside frame object queue-suffix not sended var

STOMP or XMPP - Over websocket

大憨熊 提交于 2019-12-12 08:21:30
问题 I am working on a project which involves real time chat (messaging, including group chats). I have worked with websockets before, So I started working on this using spring-websockets and I did some reading about what is the best way to implement it. Then I came across STOMP (as a sub-protocol for websockets)and as there is direct support for STOMP in spring it was bit easy to achieve what I was supposed to do. But my doubt is as far as my understanding STOMP and XMPP are similar protocols

How to keep STOMP connection longer?

一笑奈何 提交于 2019-12-12 04:04:48
问题 I'm currently writing a test echo client for STOMP over Websocket server in Java. However I noticed that the connection is somehow unpredictable as usually it's closed before message received thus client produces exception java.io.IOException: java.util.concurrent.ExecutionException: java.io.IOException: Unable to write the complete message as the WebSocket connection has been closed at org.apache.tomcat.websocket.WsRemoteEndpointImplBase.startMessageBlock(WsRemoteEndpointImplBase.java:282) ~

Sending message to specific user using spring

扶醉桌前 提交于 2019-12-12 02:39:22
问题 My Goal - To send message to single user if possible without using spring security I want to input a username from user and set it as username in spring security so that I can use method convertAndSendToUser . I searched on the net and found two approaches Using DefaultHandshakeHandler to set username but this way I am unable to retrieve user input from the page and use it in determineUser method I have tried using following piece of code Authentication request = new