Conversation
HyeonWuJeon
commented
Oct 7, 2023
| user.signOut() | ||
| userPort.patch(user) | ||
| userEventPublishPort.publishUserSignedOutEvent(UserSignedOutEvent(user.id)) | ||
| transactionalOperator.executeAndAwait { |
Contributor
Author
There was a problem hiding this comment.
'reactive transcation'을 제어하기위한 오퍼레이터 입니다.
콜백접근 방식과 코루틴 연산자를 제공하여 해당 연산자를 채택하였습니다.
'ReactiveTransactionManager'는 반드시 Mono, Flux 등의 reactor 연산자를 제공해야 합니다.
Contributor
There was a problem hiding this comment.
UserSignedOutEvent 생성 하는 영역을 User 애그리거트 안쪽으로 옮겨서 User 애그리거트에게 이벤트 생성 책임을 지우면 어떨까요?
참고: https://www.baeldung.com/spring-data-ddd
Contributor
Author
There was a problem hiding this comment.
좋은의견 감사합니다!
회원탈퇴에 의해 발생된 '이벤트 발행 객체'가 오로지 User 애그리거트에게 책임을 지울수있는 형태이니 의견주신 디자인을 적용해도 괜찮은 것 같습니다.
HyeonWuJeon
commented
Oct 30, 2023
| userPort.patch(user) | ||
| userEventPublishPort.publishUserSignedOutEvent(UserSignedOutEvent(user.id)) | ||
| transactionalOperator.executeAndAwait { | ||
| val user = getUserUseCase.getById(userId) |
Contributor
Author
There was a problem hiding this comment.
@Hee-jin506 님, 의견주신대로 코드 수정하여 반영했습니다.
JPA가 아니다보니, 서비스레이어에 코드가 한줄 늘어버렸네요 ㅜㅜ
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.
#1 #23
Type
개요
리액티브 트랜잭션을 제어하여 트랜잭션 커밋 이후에 Integration Publisher가 수행되도록 로직을 수정함.
작업 내용