Skip to content

Instantly share code, notes, and snippets.

@navichok26
Last active May 31, 2020 17:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save navichok26/8ba032343311f72dd9ff66520c17f54f to your computer and use it in GitHub Desktop.
Save navichok26/8ba032343311f72dd9ff66520c17f54f to your computer and use it in GitHub Desktop.
WebSocketConfig
@Configuration
@EnableWebSocketMessageBroker
public class WebSocketConfig implements WebSocketMessageBrokerConfigurer {
@Override
public void registerStompEndpoints(StompEndpointRegistry registry) {
registry.addEndpoint("/ws").withSockJS();
}
@Override
public void configureMessageBroker(MessageBrokerRegistry registry) {
registry.setApplicationDestinationPrefixes("/app");
registry.enableSimpleBroker("/topic");
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment