Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @Configuration
- @EnableWebSocketMessageBroker
- public class WebSocketConfig implements WebSocketMessageBrokerConfigurer {
- @Override
- public void configureMessageBroker(MessageBrokerRegistry config) {
- config.enableSimpleBroker("/topic");
- config.setApplicationDestinationPrefixes("/app");
- }
- @Override
- public void registerStompEndpoints(StompEndpointRegistry stompEndpointRegistry) {
- stompEndpointRegistry.addEndpoint("/chat")
- .setHandshakeHandler(new DefaultHandshakeHandler(new TomcatRequestUpgradeStrategy()))
- .withSockJS();
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement