Skip to content

Conversation

@BananMoon
Copy link
Contributor

  • delete: Discord 메시지 발송 기능 관련 로직, DTO 제거 (Consumer Application에 이동)
  • feat: 디스코드 알림 메시지 발송 기능을 Kafka MessageProducer로 개발
    • spring-kafka 라이브러리 추가
    • Config 정보, 클래스 추가
    • 공통 메세지, 구체적인 메세지 Dto 생성
    • Notificator: MessageProducer 호출하도록 대체
    • MessageProducer: 메세지 발행 프로듀서
  • refactor:
    • change method name, arguments
    • 패키지 이동, JavaDoc 추가
  • chore: application.yml 정리 및 카프카 정보 추가

- spring-kafka 라이브러리 추가
- Config 정보, 클래스 추가
- 공통 메세지, 구체적인 메세지 Dto 생성
- Notificator: MessageProducer 호출하도록 대체
- MessageProducer: 메세지 발행 프로듀서
chore: application.yml 정리 및 카프카 정보 추가
@BananMoon BananMoon added enhancement New feature or request refactor refactor function test code write test code labels Sep 25, 2024
@BananMoon BananMoon requested a review from yunki12 September 25, 2024 13:47
@BananMoon BananMoon self-assigned this Sep 25, 2024
@BananMoon BananMoon linked an issue Sep 25, 2024 that may be closed by this pull request
2 tasks

notificator.sendStockResultMessage(given);

verify(messageProducer, only()).produce("Stock Result Notification_TEST", given);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

테스트 코드 오류가 발생합니다.
verify는 일관성있는 검증을 위해 stub 한 동일한 매개변수로 사용해야 합니다.

예를 들어 아래와 같이 사용해야 테스트 코드가 정상 동작합니다.
verify(messageProducer, any()).produce(anyString(), any());

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

확인 감사합니다. 기존 의도와 다르게 작성된 부분이 있어 코드 수정하였습니다.

추가로 KafkaTopicType enum 클래스 내 STOCK_RESULT_NOTI_TOPIC 필드의 값을 일부 수정했는데
테스트코드에 반영되어있지 않아서 발생하는 에러도 있어, 함께 수정했습니다.

@yunki12
Copy link
Contributor

yunki12 commented Oct 3, 2024

2일에 pr push 해준 내용 까지 확인 완료 했습니다. 특이사항 없습니다.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request refactor refactor function test code write test code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

결과 메시지 발송 기능에 Kafka 적용 - 구현

3 participants