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

[Feat]: 유저 도메인 및 Adapter 이벤트 정의 및 SNS 토픽 발행 로직 구현 #156

Merged
merged 7 commits into from
Feb 2, 2024

Conversation

jihwan2da
Copy link
Member

Issue number

작업한 이유

서버 간 강한 결합 문제를 최소화 하기 위해 다른 서비스(커뮤니티 서비스등)에서 자체적으로 유저 정보를 가지고 있기 위함. -> 시스템 이벤트를 발행해 데이터 정합성을 유지하기 위해 작업하였습니다.

작업 사항

  • 유저 도메인 이벤트 설계 및 ApplicationEventPublisher 반영
    • 유저 프로필 업데이트, 유저 신뢰도 업데이트
  • Adapter 이벤트 정의 및 데이터 모델 설계 및 SNS 토픽 발행 로직 구현
    • 유저 이벤트 데이터 모델 설계
    • 이벤트 저장 로직 구현
    • SNS 토픽 발행 로직 구현
  • User 토픽 env 추가 (USER_TOPIC)

이벤트 처리 흐름
도메인 이벤트 발행(Application) TX1 -> Adapter에서 Handle(AdapterEvent로 변환) TX1 -> DataModelEvent로 변환 후 RDB에 저장 TX1 -> 저장 이벤트 발행(Application) TX1 -> 이벤트 조회 후 Message System에 발행 TX2 -> 이벤트 발행 완료 처리 TX2

TX2가 실패시 스케줄러에 의해 재발행됩니다.

DDL

create table user_event (
                               id bigint auto_increment primary key,
                               event text not null,
                               event_type varchar(50) not null,
                               created_at datetime not null,
                               published tinyint not null,
                               published_at datetime
);

@jihwan2da jihwan2da self-assigned this Feb 2, 2024
@jihwan2da jihwan2da merged commit f25ebd0 into dev Feb 2, 2024
1 check passed
jihwan2da added a commit that referenced this pull request Feb 8, 2024
* refactor: Where 어노테이션 추가로 User Entity 소프트 delete 관리하도록 변경

* feat: UserPreview 조회 쿼리 작성

* feat: User Internal Preview 조회 Service 작성

* feat: UserInternalQueryController 생성 및 Preview 조회 Controller 구현

* feat: User In id 쿼리 작성

* feat: User Intenal 일괄 조회 Service 작성

* feat: User Internal 일괄 조회 Controller 작성

* [Feat]: 유저 도메인 및 Adapter 이벤트 정의 및 SNS 토픽 발행 로직 구현 (#156)

* feat: 유저 프로필, 신뢰도 업데이트 도메인 이벤트 정의 및 발행

* feat: UserAdapterEvent 모델 설계

* feat: UserEvent 데이터 모델 설계 및 쿼리 작성

* feat: UserAdapter 이벤트 핸들러 구현

* feat: UserOutboxPayload 핸들러 작성(Outbox DB 작업 및 SNS 토픽 생성

* rename: Event -> GroupEvent

* feat: 발행 실패한 유저 이벤트 재발행 스케줄러 구현
@jihwan2da jihwan2da deleted the feat/#155 branch February 12, 2024 10:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

유저 관련 이벤트를 발행한다.
1 participant