I am implementing a STOMP endpoint in Java with Spring Boot, here's my dependency & code:
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.2.4.RELEASE</version>
<relativePath /> <!-- lookup parent from repository -->
</parent>
...
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-websocket</artifactId>
</dependency>
Java config:
@Configuration
@EnableWebSocketMessageBroker
public class WebsocketConfig implements WebSocketMessageBrokerConfigurer {
@Value("${wschannel.name}")
private String wsChannel;
@Value("${topic.prefix}")
private String topic;
@Override
public void registerStompEndpoints(StompEndpointRegistry registry) {
registry.addEndpoint("/"+wsChannel).setAllowedOrigins("*");
registry.addEndpoint("/"+wsChannel).setAllowedOrigins("*").withSockJS();
}
@Override
public void configureMessageBroker(MessageBrokerRegistry config) {
config.enableSimpleBroker(topic+"/");
}
}
It works, but I can't understand the following:
- What kind of websocket server is spring boot bringing up?
- Is it production ready?
- I also have access to a redis cluster: could I use that as websocket broker?