-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #107 from soma-baekgu/feature/BG-387-ws-connection…
…-limit [BG-387]: 유저 웹 소켓 연결 커넥션 수 제한 (4h / 2h)
- Loading branch information
Showing
10 changed files
with
146 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
17 changes: 17 additions & 0 deletions
17
...time/src/main/kotlin/com/backgu/amaker/realtime/session/service/SessionDeletePublisher.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
package com.backgu.amaker.realtime.session.service | ||
|
||
import com.backgu.amaker.infra.redis.session.SessionRedisData | ||
import org.springframework.data.redis.core.RedisTemplate | ||
import org.springframework.stereotype.Service | ||
|
||
@Service | ||
class SessionDeletePublisher( | ||
private val redisTemplate: RedisTemplate<String, SessionRedisData>, | ||
) { | ||
fun publish( | ||
serverId: String, | ||
sessionRedisData: SessionRedisData, | ||
) { | ||
redisTemplate.convertAndSend(serverId, sessionRedisData) | ||
} | ||
} |
20 changes: 20 additions & 0 deletions
20
...ime/src/main/kotlin/com/backgu/amaker/realtime/session/service/SessionDeleteSubscriber.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
package com.backgu.amaker.realtime.session.service | ||
|
||
import com.backgu.amaker.infra.redis.session.SessionRedisData | ||
import com.backgu.amaker.realtime.user.service.UserSessionService | ||
import com.backgu.amaker.realtime.workspace.service.WorkspaceSessionService | ||
import com.fasterxml.jackson.databind.ObjectMapper | ||
import org.springframework.stereotype.Service | ||
|
||
@Service | ||
class SessionDeleteSubscriber( | ||
private val workspaceSessionService: WorkspaceSessionService, | ||
private val userSessionService: UserSessionService, | ||
private val objectMapper: ObjectMapper, | ||
) { | ||
fun dropOutSessions(message: String) { | ||
val sessionRedisData = objectMapper.readValue(message, SessionRedisData::class.java) | ||
workspaceSessionService.dropOut(sessionRedisData.workspaceId, sessionRedisData.toDomain()) | ||
userSessionService.dropOut(sessionRedisData.userId, sessionRedisData.toDomain()) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters