-
Notifications
You must be signed in to change notification settings - Fork 1
[FEAT] #143 kafka 도입 비동기 이벤트 기반 추천알림 로직 개발 #144
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
base: develop
Are you sure you want to change the base?
Changes from 2 commits
08c8253
ef4f42a
928bb00
edc783b
3a8a73f
10a813f
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -167,4 +167,5 @@ public void reject(String rejectReason){ | |
| this.rejectReason = rejectReason; | ||
|
|
||
| } | ||
|
|
||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -85,6 +85,7 @@ public enum ErrorStatus implements BaseErrorCode { | |
| AMATEUR_TICKET_NOT_FOUND(HttpStatus.NOT_FOUND, "AMATEURTICKET4000", "존재하지 않는 소극장 공연 티켓입니다."), | ||
| AMATEUR_TICKET_STOCK(HttpStatus.BAD_REQUEST, "AMATEURTICKET4001", "주문 수량은 최소 1개 이상이어야 합니다."), | ||
| AMATEUR_SHOW_MISMATCH(HttpStatus.NOT_FOUND, "AMATEURTICKET4002", "회차와 티켓에 해당하는 공연이 일치하지 않습니다."), | ||
|
|
||
| // PHOTOALBUM ERROR | ||
| PHOTOALBUM_NOT_FOUND(HttpStatus.NOT_FOUND, "PHOTOALBUM4000", "존재하지 않는 사진첩입니다."), | ||
|
|
||
|
|
@@ -108,6 +109,7 @@ public enum ErrorStatus implements BaseErrorCode { | |
|
|
||
| //NOTICE ERROR | ||
| MEMBERNOTICE_NOT_FOUND(HttpStatus.NOT_FOUND, "MEMBERNOTICE4001", "존재하지 않는 알림입니다."), | ||
| NOTICE_NOT_FOUND(HttpStatus.NOT_FOUND, "NOTICE4001", "존재하지 않는 알림입니다."), | ||
|
Comment on lines
110
to
+112
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🧩 Analysis chain🏁 Script executed: cat -n src/main/java/cc/backend/apiPayLoad/code/status/ErrorStatus.java | sed -n '100,120p'Repository: SeeATheater/CC_Backend Length of output: 1396 🏁 Script executed: # Search for usages of these constants
rg "MEMBERNOTICE_NOT_FOUND|NOTICE_NOT_FOUND" -B 2 -A 2Repository: SeeATheater/CC_Backend Length of output: 1303 🏁 Script executed: # Check for any comments or documentation about notice vs membernotice
rg -i "notice" src/main/java/cc/backend/apiPayLoad/code/status/ErrorStatus.java -B 1 -A 1 | head -50Repository: SeeATheater/CC_Backend Length of output: 270 🏁 Script executed: # Search for all usages of NOTICE_NOT_FOUND more broadly
rg "NOTICE_NOT_FOUND" -r "Found in: $FILE"Repository: SeeATheater/CC_Backend Length of output: 498 🏁 Script executed: # Check for Notice service/repository files
fd -t f "Notice" src/main/java --type fRepository: SeeATheater/CC_Backend Length of output: 953 🏁 Script executed: # Look at the structure to find notice-related classes
fd -t d "notice" src/main/javaRepository: SeeATheater/CC_Backend Length of output: 98 🏁 Script executed: # Check NoticeService for how it handles not found cases
cat -n src/main/java/cc/backend/notice/service/NoticeService.javaRepository: SeeATheater/CC_Backend Length of output: 933 🏁 Script executed: # Check NoticeServiceImpl for how it handles not found cases
cat -n src/main/java/cc/backend/notice/service/NoticeServiceImpl.javaRepository: SeeATheater/CC_Backend Length of output: 12662 🏁 Script executed: # Check if there's a controller that might retrieve Notice directly
rg "noticeRepository\.findById|getNotice|Notice.*not.*found" -i -A 2 -B 2Repository: SeeATheater/CC_Backend Length of output: 10769 🏁 Script executed: # Check MemberNoticeController to understand the API patterns
head -100 src/main/java/cc/backend/notice/controller/MemberNoticeController.javaRepository: SeeATheater/CC_Backend Length of output: 2516 Remove unused
🤖 Prompt for AI Agents |
||
| // INQUIRY ERROR | ||
| INQUIRY_NOT_FOUND(HttpStatus.NOT_FOUND, "INQUIRY4000", "존재하지 않는 문의글입니다."), | ||
| FORBIDDEN_INQUIRY_ACCESS(HttpStatus.NOT_FOUND, "INQUIRY4001", "로그인한 멤버가 작성하지 않는 문의글입니다."), | ||
|
|
||
| Original file line number | Diff line number | Diff line change | ||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -11,10 +11,15 @@ | |||||||||||
| import cc.backend.board.repository.BoardRepository; | ||||||||||||
| import cc.backend.board.repository.CommentLikeRepository; | ||||||||||||
| import cc.backend.board.repository.CommentRepository; | ||||||||||||
| import cc.backend.event.entity.CommentEvent; | ||||||||||||
| import cc.backend.event.entity.ReplyEvent; | ||||||||||||
| import cc.backend.kafka.event.commentEvent.CommentEvent; | ||||||||||||
| import cc.backend.kafka.event.commentEvent.CommentProducer; | ||||||||||||
| import cc.backend.kafka.event.replyEvent.ReplyEvent; | ||||||||||||
| import cc.backend.kafka.event.replyEvent.ReplyProducer; | ||||||||||||
| import cc.backend.member.entity.Member; | ||||||||||||
| import cc.backend.member.repository.MemberRepository; | ||||||||||||
| import cc.backend.notice.event.CommentCommitEvent; | ||||||||||||
| import cc.backend.notice.event.ReplyCommitEvent; | ||||||||||||
| import cc.backend.notice.event.TicketReservationCommitEvent; | ||||||||||||
|
Comment on lines
+20
to
+22
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Remove unused import This import is not used anywhere in Proposed fix import cc.backend.notice.event.CommentCommitEvent;
import cc.backend.notice.event.ReplyCommitEvent;
-import cc.backend.notice.event.TicketReservationCommitEvent;📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||||||||
| import lombok.RequiredArgsConstructor; | ||||||||||||
| import org.springframework.context.ApplicationEventPublisher; | ||||||||||||
| import org.springframework.stereotype.Service; | ||||||||||||
|
|
@@ -32,7 +37,10 @@ public class CommentService { | |||||||||||
| private final BoardRepository boardRepository; | ||||||||||||
| private final MemberRepository memberRepository; | ||||||||||||
|
|
||||||||||||
| private final ApplicationEventPublisher eventPublisher; //이벤트 생성자 | ||||||||||||
| private final CommentProducer commentProducer; | ||||||||||||
| private final ReplyProducer replyProducer; | ||||||||||||
| private final ApplicationEventPublisher eventPublisher; | ||||||||||||
|
||||||||||||
| private final CommentProducer commentProducer; | |
| private final ReplyProducer replyProducer; | |
| private final ApplicationEventPublisher eventPublisher; | |
| private final ApplicationEventPublisher eventPublisher; |
🤖 Prompt for AI Agents
In `@src/main/java/cc/backend/board/service/CommentService.java` around lines 40 -
42, The CommentService class contains unused fields and imports for
CommentProducer, ReplyProducer, CommentEvent, and ReplyEvent; remove the
CommentProducer and ReplyProducer field declarations and any imports for
CommentEvent and ReplyEvent from the top of the file, leaving
ApplicationEventPublisher and the event types actually used (CommentCommitEvent,
ReplyCommitEvent) intact; ensure CommentService still publishes via
eventPublisher.publishEvent(...) and compile to verify no remaining references
to the removed symbols (CommentProducer, ReplyProducer, CommentEvent,
ReplyEvent) remain in the class or its imports.
This file was deleted.
This file was deleted.
This file was deleted.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🧩 Analysis chain
🏁 Script executed:
Repository: SeeATheater/CC_Backend
Length of output: 188
🏁 Script executed:
Repository: SeeATheater/CC_Backend
Length of output: 123
🏁 Script executed:
Repository: SeeATheater/CC_Backend
Length of output: 5816
Add readiness gating for Kafka and define Kafka healthcheck.
depends_ononly enforces start order, not readiness. Without a Kafka healthcheck, the suggestedcondition: service_healthycannot work. The Kafka service (lines 55–83) lacks a healthcheck entirely, and app-blue/app-green (lines 29–32, 50–52) depend on Kafka without gating on readiness. This risks startup failures if the app attempts connections before Kafka is ready.Define a Kafka healthcheck first, then gate the app services on it:
✅ Suggested adjustment
Add to Kafka service:
kafka: image: confluentinc/cp-kafka:latest container_name: kafka ports: - "9092:9092" - "29092:29092" environment: ... + healthcheck: + test: ["CMD-SHELL", "kafka-broker-api-versions.sh --bootstrap-server=localhost:9092 || exit 1"] + interval: 10s + timeout: 5s + retries: 5 + start_period: 30s volumes: - kafka_data:/var/lib/kafka/data restart: unless-stoppedThen update app services:
Apply to both app-blue and app-green.
📝 Committable suggestion
🤖 Prompt for AI Agents