Spring Boot에서 STOMP를 사용하기 위해서는 @EnableWebSocketMessageBroker 어노테이션을 사용하여 WebSocket 메시지 브로커를 활성화해야 합니다.
@Configuration @EnableWebSocketMessageBroker public class WebSocketConfiguration implements WebSocketMessageBrokerConfigurer { @Override public void registerStompEndpoints(StompEndpointRegistry registry) { // /portfolio is the HTTP URL for the endpoint to which a WebSocket (or SockJS) // client needs to connect for the WebSocket handshake registry.addEndpoint("/portfolio"); } @Override public void configureMessageBroker(MessageBrokerRegistry config) { // STOMP messages whose destination header begins with /app are routed to // @MessageMapping methods in @Controller classes config.setApplicationDestinationPrefixes("/app"); // Use the built-in message broker for subscriptions and broadcasting and // route messages whose destination header begins with /topic or /queue to the broker config.enableSimpleBroker("/topic", "/queue"); } }