代码拉取完成,页面将自动刷新
ace-monitor 项目中加入spring-boot-starter-actuator + spring-boot-starter-mail后, /health 健康检查每次去检查邮件时,耗时非常久(15s左右)。 这就导致 spring-boot-admin监控/health时, 总是报超时。 请问有没有解决办法?
报错如下:
I/O error on GET request for "http://127.0.0.1:9795/health": Read timed out; nested exception is java.net.SocketTimeoutException: Read timed out.
(通过debug和多次将邮件功能注释之后,就不会在报这个错了)
(debug过程如下:
MailHealthIndicator类中有个 this.mailSender.testConnection();方法。该方法耗时长达15s左右
)
邮件配置如下:
spring:
mail:
host: smtp.163.com
username: xxx@163.com
password: xxx
properties:
smtp:
auth: true
starttls:
enable: true
required: true
boot:
admin:
notify:
slack:
channel:
mail:
to: xx@qq.com
from: xxx@163.com
ignore-changes: UNKNOWN:UP