Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[#73] Redis Pub/Sub 구현 #75

Merged
merged 12 commits into from
Apr 23, 2024
Merged

[#73] Redis Pub/Sub 구현 #75

merged 12 commits into from
Apr 23, 2024

Conversation

hoa0217
Copy link
Collaborator

@hoa0217 hoa0217 commented Apr 22, 2024

개요

현재 구독된 클라이언트의 SseEmitter를 서버의 메모리(해시맵)에 저장하고 있다. 만약 서버를 이중화하게된다면, 서버끼리 공유가 되지 않기때문에 이벤트 발행 서버와 유저가 구독한 서버가 다르면 알림을 전송하지 못하는 이슈가 발생한다.

작업사항

image

  • RedisMessageListenerContainer 설정
  • Redis Channel Subscriber, Publisher 생성
    • 클라이언트가 SseEmitter 구독 시, Channel(클라이언트 이메일 ) 구독
    • 알람 발생 시, Channel(클라이언트 이메일)에 이벤트(알람내용) Publish

변경로직

  • Exception 생성자 추가 (전체적인 리팩토링 필요)

참고: [이펙티브 자바] 아이템 75. 예외의 상세 메세지에 실패 관련 정보를 담으라

  • SseEmitterService 클래스를 생성하여 SseEmitter관련 로직 위임

@hoa0217 hoa0217 requested a review from f-lab-bot April 22, 2024 18:06
@hoa0217 hoa0217 self-assigned this Apr 22, 2024
Copy link

⭐️Code Coverage

Overall Project 77.5% -0.47% 🍏
Files changed 81.96% 🍏

File Coverage
RedisConfig.java 100% 🍏
EmitterMemoryRepository.java 100% 🍏
RedisPublisher.java 100% 🍏
RedisMessageService.java 100% 🍏
AlarmService.java 88.14% -6.78% 🍏
RedisSubscribeListener.java 86% -14% 🍏
SseEmitterService.java 84.29% -15.71% 🍏
AlarmConsumer.java 80.56% -16.67%
AlarmProducer.java 80.56% -16.67%
CustomErrorHandler.java 73.33% 🍏
MessageParsingError.java 50% 🍏
AlarmController.java 18.75% -22.92%
SSEConnectError.java 0%

@hoa0217 hoa0217 merged commit a5c379d into develop Apr 23, 2024
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant