문서의 선택한 두 판 사이의 차이를 보여줍니다.
양쪽 이전 판 이전 판 다음 판 | 이전 판 | ||
java:mail [2014/03/20 17:59] kwon37xi 새로 만듦 |
java:mail [2014/06/15 22:01] kwon37xi |
||
---|---|---|---|
줄 6: | 줄 6: | ||
===== Dependencies ===== | ===== Dependencies ===== | ||
- | * Javamail 1.5 부터는 | + | * Javamail 1.5 부터는 구현체가 |
* [[http:// | * [[http:// | ||
* [[http:// | * [[http:// | ||
줄 12: | 줄 12: | ||
===== 설정 ===== | ===== 설정 ===== | ||
* [[https:// | * [[https:// | ||
+ | |||
+ | ==== Java Mail의 connection timeout 문제점 ==== | ||
+ | * [[http:// | ||
+ | * Java mail은 기본적으로 connection timeout 이 무한대이다. 따라서 커넥션이 하나라도 안 맺어지면 해당 쓰레드는 무한히 멈추게 된다. 모든 timeout 종류가 다 그렇기 때문에 **항상 timeout을 명시**해줘야 한다.< | ||
+ | String MAIL_SMTP_CONNECTIONTIMEOUT =" | ||
+ | String MAIL_SMTP_TIMEOUT = " | ||
+ | String MAIL_SMTP_WRITETIMEOUT = " | ||
+ | String MAIL_SOCKET_TIMEOUT = " | ||
+ | |||
+ | // Set a fixed timeout of 60s for all operations - | ||
+ | // the default timeout is " | ||
+ | props.put(MAIL_SMTP_CONNECTIONTIMEOUT, | ||
+ | props.put(MAIL_SMTP_TIMEOUT, | ||
+ | props.put(MAIL_SMTP_WRITETIMEOUT, | ||
+ | </ | ||
+ | * DNS Roud robin을 사용할 경우(Amazon S3 등) DNS 캐시를 꺼야 한다.< | ||
+ | // Only cache DNS lookups for 10 seconds | ||
+ | java.security.Security.setProperty(" | ||
+ | </ | ||