Conversation
WalkthroughMPS 주문 타입에 대한 조건부 이벤트 처리 및 로깅을 추가했습니다. PartOrderEventService에서 MPS 관련 이벤트를 별도로 발행하고, FactoryOutboxPublisher에 상세 로깅을 추가하며, PartOrderService에서 상태 전환 시 완료 이벤트를 발행합니다. Kafka 리스너 groupId를 동적 속성으로 변경했습니다. Changes
Sequence Diagram(s)sequenceDiagram
participant OrderService as PartOrderService
participant EventService as PartOrderEventService
participant OutboxPublisher as FactoryOutboxPublisher
participant Kafka as Kafka
OrderService->>OrderService: getPartOrders()
OrderService->>OrderService: 상태 변경 감지<br/>(IN_PROGRESS → COMPLETED)
OrderService->>EventService: recordPartOrderCompleted()
alt MPS 주문 타입
EventService->>EventService: MpsCompleted 이벤트 생성
Note over EventService: logging 추가
else 일반 PartOrder
EventService->>EventService: PartOrderCompleted 이벤트 생성
end
EventService->>OutboxPublisher: 이벤트 저장 및 발행
rect rgb(200, 220, 255)
Note over OutboxPublisher: MPS 이벤트 처리
OutboxPublisher->>OutboxPublisher: [발행 전] 로깅<br/>(OUTBOX ID, EventType)
OutboxPublisher->>OutboxPublisher: JSON 변환<br/>(Topic, JsonLength)
OutboxPublisher->>OutboxPublisher: [전송 전] 로깅<br/>(EventType, Key)
end
OutboxPublisher->>Kafka: 메시지 발행
Kafka-->>OutboxPublisher: 성공
OutboxPublisher->>OutboxPublisher: [발행 후] 로깅<br/>(OUTBOX ID, 상태)
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes
Possibly related PRs
Suggested labels
Suggested reviewers
Poem
Pre-merge checks and finishing touches❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (4)
src/main/java/com/sampoom/factory/api/factory/outbox/FactoryOutboxPublisher.java(1 hunks)src/main/java/com/sampoom/factory/api/part/service/PartOrderEventService.java(2 hunks)src/main/java/com/sampoom/factory/api/part/service/PartOrderService.java(1 hunks)src/main/java/com/sampoom/factory/common/handler/ProjectionEventHandler.java(1 hunks)
🧰 Additional context used
🧠 Learnings (1)
📚 Learning: 2025-11-10T02:39:29.568Z
Learnt from: taemin3
Repo: 33-Auto/Sampoom-Management-Backend-Factory PR: 34
File: src/main/java/com/sampoom/factory/api/part/service/PartOrderService.java:668-682
Timestamp: 2025-11-10T02:39:29.568Z
Learning: In the Sampoom Factory project, PartOrder entities always contain only one item per order. The `createPartOrdersSeparately` method in PartOrderService creates individual orders for each item. Therefore, N+1 query concerns in the toResponseDto and toProductionPlanResponseDto methods are not applicable since N is always 1.
Applied to files:
src/main/java/com/sampoom/factory/api/part/service/PartOrderEventService.javasrc/main/java/com/sampoom/factory/api/part/service/PartOrderService.java
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
- GitHub Check: Analyze (java-kotlin)
src/main/java/com/sampoom/factory/api/part/service/PartOrderService.java
Show resolved
Hide resolved
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
📝 Summary
🙏 Question & PR point
📬 Reference
Summary by CodeRabbit
새로운 기능
개선사항