stomp

Stuck with “A cluster on a single machine” explained in https://www.rabbitmq.com/clustering.html

本秂侑毒 提交于 2019-12-23 03:39:31
问题 I am following "A cluster on a single machine" explained in https://www.rabbitmq.com/clustering.html but it is not working as it is. I am using ubuntu 14.04 64 bit. root@sunny-workstation:~# RABBITMQ_NODE_PORT=5673 RABBITMQ_SERVER_START_ARGS="- rabbitmq_management listener [{port,15673}]" RABBITMQ_NODENAME=hare rabbitmq-server & [1] 17990 root@sunny-workstation:~# RabbitMQ 3.2.4. Copyright (C) 2007-2013 GoPivotal, Inc. ## ## Licensed under the MPL. See http://www.rabbitmq.com/ ## ## #########

Spring Boot - Websockets - How to see subscribers

瘦欲@ 提交于 2019-12-23 01:52:32
问题 I'm working on a websocket application where I'm trying to have one websocket that feeds information in, and then outputs to subscribers to the endpoint. I've figure that out, but I'm wondering if there is a way to see what subscribers are subscribed and to what path? Here is a code sample of what I'm working on. @Autowired private SimpMessagingTemplate template; @MessageMapping("/{companyId}/{departmentId}") @SendTo("/{companyId}/{departmentId}") public void companyInformation(

PHP:Stomp - Is it possible to catch errors on “send()”?

时间秒杀一切 提交于 2019-12-22 13:57:07
问题 I'm using the PHP Stomp client to send a stomp message. I would like to leave a persistent connection open, in the background, and send messages occasionally. However, I can't find a way to handle connection errors if they happen after opening the connection (on send()). For example, when running: <?php $stomp = new Stomp('tcp://localhost:61613'); sleep(5); // Connection goes down in the meantime $result = $stomp->send('/topic/test', 'TEST'); print "send " . ($result ? "successful\n": "failed

Websocket java client Spring + Stomp: Transport error: ConnectionLostException

给你一囗甜甜゛ 提交于 2019-12-22 10:11:09
问题 I'm trying to create an standalone Java app as a websocket client using for this Spring with Stomp and Sockjs, taking in consideration the spring specifications and the spring-portafolio examples and I'm getting this error: 15:18:01.342 [main] DEBUG com.example.client.WebSocketClientTest - Connecting to : ws://localhost:8080/socket/hello 15:18:01.541 [WebSocketClient-AsyncIO-1] ERROR com.example.client.MyStompSessionHandler - Transport error org.springframework.messaging.simp.stomp

Spring 4 websocket + stomp + rabbitmq and clustering

廉价感情. 提交于 2019-12-22 07:51:30
问题 I am going through Spring 4 websocket + stomp + rabbitmq(RabbitMQ-Web-Stomp plugin) architecture and I have a question about clustering. As per my understanding here Spring MVC act as a gateway for STOMP requests. If we cluster the application instance with spring web socket configuration will it create any confusion? For an example will it open multiple listeners and how will in such a case this architecture behave? 回答1: In this scenario, you would need to use load balancing and a message

Spring websockets without principal

╄→尐↘猪︶ㄣ 提交于 2019-12-21 21:45:45
问题 I am trying to implement a simple websockets application that can send messages from one endpoint to a specified session established elsewhere. So far I have been able to use the annotation @SendToUser() in order for a client to subscribe to a channel (as discussed in this question: Spring Websockets @SendToUser without login?) However, I now want to create a separate endpoint that, when called, looks up a user associated with data passed into this endpoint and sends a message to that user

Spring STOMP sending messages from anywhere in the application

ぐ巨炮叔叔 提交于 2019-12-21 16:53:30
问题 I am building an application using Stomp to broker messages over websockets. I am trying to send messages from the server to the client without a request from anywhere in the application. I found two separate choices online for sending messages from anywhere in the application. The first is found in the Websocket documentation. Section 20.4.5: @Controller public class GreetingController { private SimpMessagingTemplate template; @Autowired public GreetingController(SimpMessagingTemplate

Spring websocket with stomp security - every user can subscribe to any other users queue?

痞子三分冷 提交于 2019-12-21 04:48:06
问题 I created a simple app that uses the websockets mechanism of spring 4. I use in my app an activemq broker. In my simple test i create 10 messages for a user named "Alejando" (user/alejandro/queue/greetings) When i log in with "Alejando" and subscribe to that queue: stompClient.subscribe('/user/alejandro/queue/greetings', function(greeting){ showGreeting(JSON.parse(greeting.body).content); }); I indeed receive all the 10 messages that were enqued for alejandro. The problem is when i log in

Spring, how to broadcast message to connected clients using websockets?

非 Y 不嫁゛ 提交于 2019-12-21 03:42:29
问题 I am trying to use websockets in my app. I have followed this tutorial: http://spring.io/guides/gs/messaging-stomp-websocket/ It works perfectly. When one of connected clients press button, this method is called: @MessageMapping("/hello") @SendTo("/topic/greetings") public Greeting greeting() throws Exception { System.out.println("Sending message..."); Thread.sleep(1000); // simulated delay return new Greeting("hello!"); } and message is broadcasted to all of connected clients. Now i want to

dynamic message-mapping for websockets in Spring 4

て烟熏妆下的殇ゞ 提交于 2019-12-20 16:52:32
问题 I want to develop a small chat with springs new websocket/stomp support. I guess i cannot use something like this: @MessageMapping("/connect/{roomId}") @SendTo("/topic/newMessage") public String connectToChatRoom(@PathVariable String roomId, Principal p) { return getTimestamp() + " " + p.getName() + " connected to the room."; } What are my options for dynamic mapping here? As a client i want to subscribe only to the room I'm in. Thanks in advance! 回答1: Figured it out, you need to use