Skip to content

Commit

Permalink
chore: WebSocketConfig 주석 추가
Browse files Browse the repository at this point in the history
  • Loading branch information
hyun98 committed Oct 14, 2023
1 parent 127403b commit 31401b5
Showing 1 changed file with 10 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,25 @@ import org.springframework.web.socket.config.annotation.StompEndpointRegistry
import org.springframework.web.socket.config.annotation.WebSocketMessageBrokerConfigurer


/**
* WebSocket 설정을 관리하는 클래스
*/
@Configuration
@EnableWebSocketMessageBroker
class WebSocketConfig : WebSocketMessageBrokerConfigurer {

/**
* 목적지 prefix 가 "/sub" 인 메시지를 필터링합니다. (outbound)
* 도착지 prefix 가 "/pub" 인 메시지를 필터링합니다. (inbound)
*/
override fun configureMessageBroker(config: MessageBrokerRegistry) {
config.enableSimpleBroker("/sub")
config.setApplicationDestinationPrefixes("/pub")
}

/**
* STOMP endpoint 를 설정합니다.
*/
override fun registerStompEndpoints(registry: StompEndpointRegistry) {
registry
.addEndpoint("/ws-stomp")
Expand Down

0 comments on commit 31401b5

Please sign in to comment.