Skip to content

Commit

Permalink
[feat] #155 webSocketConfig.java 에 heartbeat 수신 코드 추가
Browse files Browse the repository at this point in the history
  • Loading branch information
hyeesw committed Sep 23, 2024
1 parent 5c0fe99 commit 165773d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ public void registerStompEndpoints(final StompEndpointRegistry registry) {
@Override
public void configureMessageBroker(final MessageBrokerRegistry registry) {
registry.setApplicationDestinationPrefixes("/pub"); // 발행요청
registry.enableSimpleBroker("/sub"); // 구독요청
registry.enableSimpleBroker("/sub")// 구독요청
.setHeartbeatValue(new long[]{0, 10000}); // 클라이언트로부터 10초마다 ping 받는것으로 소켓 연결 유지
}
}
2 changes: 2 additions & 0 deletions src/main/java/com/book/backend/util/JwtUtil.java
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
import jakarta.servlet.http.HttpServletRequest;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.exception.ExceptionUtils;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.security.core.Authentication;
Expand All @@ -18,6 +19,7 @@

import java.security.PublicKey;
import java.util.Date;
import java.util.Objects;
import java.util.concurrent.TimeUnit;

@Slf4j
Expand Down

0 comments on commit 165773d

Please sign in to comment.