spring-websocket

WebSocketMessageBrokerStats - how to set loggingPeriod

孤街醉人 提交于 2020-04-15 10:40:42
问题 How to set loggingPeriod in WebSocketMessageBrokerStats to decrease value (default is 30') WebSocketMessageBrokerStats is loaded by @Bean in WebSocketMessageBrokerConfigurationSupport version : Spring 4.2.0.RELEASE My current Config : @Configuration @EnableWebSocketMessageBroker @EnableScheduling public class AppWebSocketConfig extends AbstractWebSocketMessageBrokerConfigurer { @Override public void configureMessageBroker(final MessageBrokerRegistry config) { config.enableSimpleBroker("/topic

Modify Spring Security Config at Runtime

岁酱吖の 提交于 2020-04-14 07:33:09
问题 I am using the latest Spring Boot + Spring Boot Starter Security for a simple proxy application. The goal is to launch the application with a single route/method: @RequestMapping(value = "/api/register", method = RequestMethod.POST, produces = MediaType.APPLICATION_JSON_VALUE) @Timed public ResponseEntity<?> register(Registration registration) { With a security configuration of: @Override protected void configure(HttpSecurity http) throws Exception { this.http = http .authorizeRequests()

Modify Spring Security Config at Runtime

|▌冷眼眸甩不掉的悲伤 提交于 2020-04-14 07:32:10
问题 I am using the latest Spring Boot + Spring Boot Starter Security for a simple proxy application. The goal is to launch the application with a single route/method: @RequestMapping(value = "/api/register", method = RequestMethod.POST, produces = MediaType.APPLICATION_JSON_VALUE) @Timed public ResponseEntity<?> register(Registration registration) { With a security configuration of: @Override protected void configure(HttpSecurity http) throws Exception { this.http = http .authorizeRequests()

Spring 5 WebFlux server push notifications via RSocket protocol

旧时模样 提交于 2020-03-23 07:55:18
问题 The case is the following: After as clients A and B established connections with a server via RSocket protocol, each of the clients could be notified with their own event(s) ( event A or event B ) to trigger some action on a client ( event X -> action on client X ). Thanks 回答1: You could achieve it with setup payload. Server: @Controller public class ServerController { private static final Map<String, RSocketRequester> REQUESTER_MAP = new HashMap<>(); @ConnectMapping("client-id") void

Exposing metrics about current Websocket connections with Spring

 ̄綄美尐妖づ 提交于 2020-03-22 11:05:49
问题 For my dashboarding application I want to monitor my Spring Boot based application with internal Spring metrics. Therefor I am using the spring-boot-actuator dependency which is exposing a lot of internal metrics. There are a lot of HTTP based metrics and Tomcat metrics like current sessions, amount of HTTP calls of status X and so on. I coulnd't find any information regarding my Websocket connections. Is there any build-in out of the box metrics exposing tool for the current Websockets with

Where does @serverendpoint path get mapped (Websockets)

坚强是说给别人听的谎言 提交于 2020-02-25 23:06:35
问题 I have the following @serverendpoint path for a websocket that I am using with the spring framework: @ServerEndpoint(value="/serverendpoint", configurator = SpringConfigurator.class) My first question is say I have a website with the url www.example.com . Where does the serverendpoint with path serverendpoint get mapped? Can I access my serverendpoint at wss://example.com:$PORT/currentpage.html/serverendpoint ? Or is this the wrong way. I have a Wildfly 10 server running. Based on another SO

Spring 4 Web sockets - Do i must have a stomp broker?

我怕爱的太早我们不能终老 提交于 2020-02-25 05:50:09
问题 Iv'e been using the following link in order to play with the new spring 4 websockets: http://spring.io/guides/gs/messaging-stomp-websocket/ I was wondering if i must use a stomp broker in order to use the spring framework ? is there any broker less way to use it? thanks 回答1: This guide is using the simple broker implementation provided in Spring Framework. It's just a piece of Java code that plays that part - there's no actual broker in that setup. So yes, there is a broker-less way to use

Spring 4 Web sockets - Do i must have a stomp broker?

纵饮孤独 提交于 2020-02-25 05:49:30
问题 Iv'e been using the following link in order to play with the new spring 4 websockets: http://spring.io/guides/gs/messaging-stomp-websocket/ I was wondering if i must use a stomp broker in order to use the spring framework ? is there any broker less way to use it? thanks 回答1: This guide is using the simple broker implementation provided in Spring Framework. It's just a piece of Java code that plays that part - there's no actual broker in that setup. So yes, there is a broker-less way to use

Handle the same URL with Spring MVC RequestMappingHandlerMapping and Spring Websocket's ServletWebSocketHandlerRegistry

假如想象 提交于 2020-01-31 03:20:35
问题 What do I want to have: Client sends GET / HTTP/1.1 (without Connection: upgrade ) - this request should be handled by RequestMappingHandlerMapping Client sends Connection: upgrade along with GET request - this request should be handled by ServletWebSocketHandlerRegistry My Java configuration: @Configuration @EnableWebSocket public class WebsocketConfiguration extends WebMvcConfigurationSupport implements WebSocketConfigurer { @Bean WebsocketComponent wsHandler() { return new

Spring 4 AbstractWebSocketMessageBrokerConfigurer With SockJS Not Negotiating Transport Properly

自作多情 提交于 2020-01-22 20:03:06
问题 So I must say that all of the websocket tutorials/examples appear to be so easy, but it seems you really have to dig to find really important pieces of information that are left out of the simple examples. I'm stil having quite a few issues with my webapp using the Spring 4 Stomp message broker with SockJS on the front end. Currently, if I add an endpoint to the StompEndpointRegistry without enabling SockJS(), then declare my socket on the front end using dojo's dojox/socket, Firefox 28 will