1

我正在使用 Spring boot admin 并尝试在服务出现故障时获取邮件通知以及其他通知,例如手机上的消息。我已经尝试了一些东西,但它没有工作。我应该怎么做?

4

1 回答 1

4

您只需将 JavaMailSender 添加到您的 SBA 服务器。最简单的方法是使用 Spring Boot 的邮件启动器和 AutoConfigurations,因此您只需要这两个步骤:

(请配置您正确的 smtp 服务器和邮件接收器(可能需要凭据)!)

pom.xml:

<dependency>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-starter-mail</artifactId>
</dependency>

应用程序属性:

spring.mail.host=smtp.example.com
spring.boot.admin.notify.mail.to=admin@example.com

ps这只是取自这里的文档:http: //codecentric.github.io/spring-boot-admin/1.4.6/#mail-notifications

pps 没有将消息推送到手机的通知器实现,如果你写一个我会对我们的 GitHub 项目上的 PR 感兴趣。

于 2017-02-22T20:42:17.233 回答