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: email 전송 api 변경 #205

Open
wants to merge 3 commits into
base: develop
Choose a base branch
from

Conversation

IW-MOON
Copy link
Collaborator

@IW-MOON IW-MOON commented Apr 23, 2023

📌Linked Issues

✏Change Details

  • email 전송 시, AWS SES를 사용함으로써 속도개선
    기존 : 5초 가량 소요
    현재 : 0.5초 가량 소요
    image

💬Comment

📑References

✅Check List

  • [✅] 추가한 기능에 대한 테스트는 모두 완료하셨나요?
  • [✅] 코드 정렬(Ctrl + Alt + L), 불필요한 코드나 오타는 없는지 확인하셨나요?

@IW-MOON IW-MOON added the feature 새로운 기능 개발 label Apr 23, 2023
@IW-MOON IW-MOON self-assigned this Apr 23, 2023
@IW-MOON IW-MOON force-pushed the feature/195-improve-mail-api branch from 805e1d1 to ff55e08 Compare April 23, 2023 12:29
@IW-MOON IW-MOON force-pushed the feature/195-improve-mail-api branch from ff55e08 to 1afaab3 Compare April 23, 2023 12:53
@sonarcloud
Copy link

sonarcloud bot commented Apr 23, 2023

SonarCloud Quality Gate failed.    Quality Gate failed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot E 1 Security Hotspot
Code Smell A 1 Code Smell

0.0% 0.0% Coverage
0.0% 0.0% Duplication

Copy link
Member

@junhaesung junhaesung left a comment

Choose a reason for hiding this comment

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

고생하셨습니다-
Google SMTP 로 이메일 발송하는 코드를 제거하지 말고, AWS SES 장애일 때 Fallback 등으로 사용하면 어떨까요?
그리고 이메일 API 변경하고나서 이전과 성능이나 비용 등의 부분에서 어떤 차이가 있는지도 공유해주시면 좋을 것 같습니다.

@@ -13,6 +13,7 @@ dependencies {
implementation("io.springfox:springfox-swagger2:2.9.2")

implementation "com.amazonaws:aws-java-sdk-s3:${awsJavaSdkVersion}"
implementation 'com.amazonaws:aws-java-sdk-ses:1.12.188'
Copy link
Member

Choose a reason for hiding this comment

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

library 버전을 상수로 선언해서 사용하면 좋을 것 같습니다.

import org.springframework.context.annotation.Configuration;

@Configuration
public class AwsSesConfig {
Copy link
Member

Choose a reason for hiding this comment

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

메일 발송은 배치나 어드민에서도 사용할 수 있는 기능이어서, domain 모듈에 추가되어도 좋을 것 같습니다.

@@ -23,5 +23,9 @@ cloud:
s3:
connection-timeout: 1000
request-timeout: 3000
ses:
access-key: ENC(DB73NBzZBXtuco5qOP1/jtb+hE69JqfkbcuiM43tPG9sWNms0P+pqFaYc3gsAauMKMtI7Uz3JyOOIqztitWLcA==)
Copy link
Member

Choose a reason for hiding this comment

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

dev, prod 의 aws 계정이 각각 다른데 같은 키를 사용하나요? 환경별로 분리하는게 좋을 것 같아서요.


@Service
@RequiredArgsConstructor
public class AwsSesService {
Copy link
Member

Choose a reason for hiding this comment

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

특정 벤더나 구현에 의존하는 구조보다는EmailService 등의 인터페이스를 선언하고, AwsSesService, GoogleSmtpService 등으로 각각의 구현체를 관리하는게 좋을 것 같습니다.

@sonarcloud
Copy link

sonarcloud bot commented Jun 25, 2023

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 2 Code Smells

20.6% 20.6% Coverage
0.0% 0.0% Duplication

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature 새로운 기능 개발
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants