stomp

Error opening websocket connection using spring 4

自古美人都是妖i 提交于 2019-12-11 20:10:09
问题 I am trying to create a websocket using this tutorial . Everything is good except that when I try to open websocket connection I get the following error on my browser console and nothing happens at all. Please help me out. Error: Opening web socket... GET http://localhost:8080/hello/info?t=1445510124841 404 (Not Found) Whoops! Lost connection to http://localhost:8080/hello TestController.java package com.test.controller; import java.util.Set; import javax.servlet.http.HttpServletRequest;

Error handling while using STOMP simple broker

孤街醉人 提交于 2019-12-11 18:33:28
问题 I am creating simple STOMP broker using @EnableWebSocketMessageBroker . When RuntimeException happens in @MessageMapping method I would like to receive STOMP ERROR frame, but it doesn't work like that by default. It seems that ERROR frame is not supported in simple broker: https://github.com/spring-projects/spring-framework/blob/master/spring-messaging/src/main/java/org/springframework/messaging/simp/SimpMessageType.java#L28-L44 On the other hand, there is a mechanism to send ERROR frames

How to register stomp subscriptions in Spring

前提是你 提交于 2019-12-11 15:23:11
问题 I want to control stomp subscription in my Spring application with spring-messaging v.4.2. This is my Spring app configuration for stomp: @Configuration @EnableWebMvc @ComponentScan(basePackages = "com.myapp") @EnableWebSocketMessageBroker @EnableAsync @EnableScheduling public class Config extends AbstractWebSocketMessageBrokerConfigurer { @Override public void configureMessageBroker(MessageBrokerRegistry config) { config.enableSimpleBroker("/queue", "/topic"); config

PHP Stomp: Reading all messages in a queue

纵饮孤独 提交于 2019-12-11 10:53:15
问题 I need to find a specific message within an ActiveMQ queue using PHP and remove it. AFAIK the only way to do so is to read all messages that are currently queued and ACK the one message I'm interested in. (The example in the PHP manual for Stomp::ack does more or less the same thing, they don't read all messages, but only ACK the one that matches). So, I wrote this code (this is only the relevant part, obviously): class StompController { private $con; public function __construct(

Spring security 4.0.1 and Spring 4.2.0.RC1 stompBrokerRelayMessageHandler bean error with RabbitMQ

拈花ヽ惹草 提交于 2019-12-11 10:47:20
问题 I have an spring boot application. I have just upgrade my pom file to use spring security 4.0.1 together with spring-boot-starter-parent 1.3.0.M1 and i am seeing this error when i changed to spring boot 1.3.0.M1. org.springframework.context.ApplicationContextException: Failed to start bean 'stompBrokerRelayMessageHandler'; nested exception is java.lang.NoClassDefFoundError: reactor/io/codec/Codec at org.springframework.context.support.DefaultLifecycleProcessor.doStart

Push Message from ActiveMQ to Spring Controller

时间秒杀一切 提交于 2019-12-11 03:55:22
问题 I'm using Spring MVC, ActiveMQ and WebSocket(via sock.js and stomp.js ) to build a real-time data delivery application. As we know, when a producer(another desktop application) push a message to ActiveMQ, and the onMessage() method will catch it. public class MessageReceiver implements MessageListener { public void onMessage(Message message) { System.out.println(message); // How to push the message to a Controller in Spring? } } Most of the tutorials just print the message to the console. I

SimpMessagingTemplate vs MessageSendingOperations

走远了吗. 提交于 2019-12-11 02:18:50
问题 I've just started to study Spring 4 stomp over websocket. What are the differences between these two? What cases should I use one over the another? 回答1: There is no difference: MessageSendingOperations is an interface - contract. SimpMessagingTemplate is a concrete implementation of the first one. Typically it's enough to configure bean for concrete implementation, but inject it by type of its conctract: @Bean public MessageSendingOperations messagingTemplate() { return new

Spring WebSockets XML configuration not providing brokerMessagingTemplate

梦想与她 提交于 2019-12-10 18:35:08
问题 I'm trying to add in WebSockets support using STOMP to a Spring MVC application that is configured using XML. So far this has gone really well, and I've managed to get a WebSockets server listening, and stomp.js can connect to it and send messages and receive responses. What I've not managed to get working yet is the support for the server to send arbitrary messages to the client that aren't responses to one received from the client. That means this is actually just a more complicated version

No cookies during /info request using sockjs and stomp

时光毁灭记忆、已成空白 提交于 2019-12-10 18:02:56
问题 I'm trying to use Spring Security with websockets. As an example I'm using spring-websocket-chat (https://github.com/salmar/spring-websocket-chat) — demo application from talk "Deep dive into websockets". In that application CookieHttpSessionStrategy uses for storing session id, stored during authentication cookie is sending with /info request. Here are code that demonstrates connecting to server via sockjs (this request sends cookies) https://github.com/salmar/spring-websocket-chat/blob

RabbitMQ 3.1.3 and the missing timestamp header

雨燕双飞 提交于 2019-12-10 17:39:54
问题 Is it possible to configure the broker to insert a timestamp header if it is missing in the message? So if the publishing client does not add the timestamp header, can the broker insert it with a timestamp value matching the moment the message was received by the exchange? Where should I look for that configuration? Or is that a bad idea? 回答1: So to answer your question, no there is no way to configure the broker to insert a timestamp. Nothing the in AMQP specification requires a message to