Skip to content

Commit

Permalink
✨: feat SQS Producer에서 SQS로 알림 발송 retry 실패 시, recover 처리를 통한 error 로깅…
Browse files Browse the repository at this point in the history
… 및 Slack 알림
  • Loading branch information
PgmJun committed Sep 21, 2024
1 parent 8af22fa commit c939fc9
Showing 1 changed file with 7 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,13 @@ public void produce(MessageDto dto) {
}
}

@Recover
private void recoverListener(AmazonSQSException exception, MessageDto dto) {
throw new InternalServerException(
String.format("SQS로 메시지를 Produce 하는 과정에서 에러가 발생하며 메시지 발행에 실패하였습니다. :: Message -> %s", dto.toString())
, SQS_EXCEPTION);
}

private Map<String, MessageAttributeValue> createMessageAttributes(String type) {
final String dataType = "String";
return Map.of(MessageType.MESSAGE_TYPE_HEADER, new MessageAttributeValue()
Expand Down

0 comments on commit c939fc9

Please sign in to comment.