4.1K Star 18.9K Fork 8.6K

GVP江离 / Cloud-Platform

 / 详情

ace-monitor 项目加入邮件通知功能后,ace-monitor项目通过/health健康检查时,总是报超时

已完成
创建于  
2018-01-10 10:38

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

评论 (1)

最后 创建了任务

这个我没验证过呢。看下是不是考虑将发送过程异步,或者加入消息队列呢?

江离 关闭了任务

登录 后才可以发表评论

状态
负责人
里程碑
Pull Requests
关联的 Pull Requests 被合并后可能会关闭此 issue
分支
开始日期   -   截止日期
-
置顶选项
优先级
参与者(2)
547642 geek qi 1578927276 1219829 zuihou111 1578946597
Java
1
https://gitee.com/geek_qi/cloud-platform.git
git@gitee.com:geek_qi/cloud-platform.git
geek_qi
cloud-platform
Cloud-Platform

搜索帮助

344bd9b3 5694891 D2dac590 5694891