This article introduces the upstream and downstream email notifications of Spring Boot Admin monitoring service. It is shared with everyone, as follows:
Under the microservice architecture, the number of services can range from dozens to hundreds, which is essential for monitoring services.
If it is a previous single project, it is fixed to start several projects. You can monitor them through a third-party monitoring tool and then alert them in real time.
Under microservices, there are too many services and can be expanded at any time. At this time, the monitoring function of third-party is not applicable. We can connect to the registration center through Spring Boot Admin to view the service status, which can only be viewed on the page.
Many times, I hope to be able to monitor automatically and alert via email. A certain service has removed such a function. In fact, this function is already available in Spring Boot Admin. We only need to configure some email information to use it.
First introduce the dependencies required for email:
<dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-mail</artifactId></dependency>
Then add the mail server information to the configuration file:
spring.mail.host=smtp.qq.comspring.mail.username=1304489315@qq.comspring.mail.password=authorization code of the qq mailbox spring.mail.properties.mail.smtp.auth=truespring.mail.properties.mail.smtp.starttls.enable=truespring.mail.properties.mail.smtp.starttls.required=true# Who to send to [email protected]# Who sent it out [email protected]
After the configuration is completed, when the service is online and offline, your email address can receive an email.
The above is all the content of this article. I hope it will be helpful to everyone's learning and I hope everyone will support Wulin.com more.