diff --git a/src/main/kotlin/com/hero/alignlab/ws/handler/ReactiveConcurrentUserWebSocketHandler.kt b/src/main/kotlin/com/hero/alignlab/ws/handler/ReactiveConcurrentUserWebSocketHandler.kt index 97a00b7..5fc6a27 100644 --- a/src/main/kotlin/com/hero/alignlab/ws/handler/ReactiveConcurrentUserWebSocketHandler.kt +++ b/src/main/kotlin/com/hero/alignlab/ws/handler/ReactiveConcurrentUserWebSocketHandler.kt @@ -40,8 +40,6 @@ class ReactiveConcurrentUserWebSocketHandler( private val concurrentUserByMap: ConcurrentMap> = ConcurrentHashMap() override fun handle(session: WebSocketSession): Mono { - println(">> 접속함") - val groupId = session.handshakeInfo.uri.path .split("/") .lastOrNull { it.matches(Regex("\\d+")) } @@ -59,8 +57,6 @@ class ReactiveConcurrentUserWebSocketHandler( val user = authFacade.resolveAuthUser(authUserToken) - println("concurrent user : ${user.uid}") - val groupUsers = groupUserService.findAllByUidSync(user.uid) groupUsers.forEach { groupUser -> @@ -95,6 +91,18 @@ class ReactiveConcurrentUserWebSocketHandler( return session.receive() .map(WebSocketMessage::getPayloadAsText) + .flatMap { payload -> + when { + payload.contains("ping") -> { + session.send(Mono.just(session.textMessage("pong"))) + } + + else -> { + logger.warn { "UNDEFINED WS MESSAGE : $payload" } + Mono.empty() + } + } + } .log() .doFinally { handleSessionTermination(session, user.uid) } .then()