亚洲精品久久久中文字幕-亚洲精品久久片久久-亚洲精品久久青草-亚洲精品久久婷婷爱久久婷婷-亚洲精品久久午夜香蕉

您的位置:首頁(yè)技術(shù)文章
文章詳情頁(yè)

Spring Boot Admin郵件警報(bào)整合過(guò)程解析

瀏覽:3日期:2023-09-13 11:09:14

一、前言

在Spring Boot Admin Server 中撒送預(yù)警郵件通知是很簡(jiǎn)單的,只需要簡(jiǎn)單的幾個(gè)配置就可以了。

二、代碼演示

1、microservice-monitor-server-> pom.xml

<?xml version='1.0' encoding='UTF-8'?><project xmlns='http://maven.apache.org/POM/4.0.0' xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xsi:schemaLocation='http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd'> <parent> <artifactId>microservice-minitor</artifactId> <groupId>com.microservice</groupId> <version>1.0-SNAPSHOT</version> </parent> <modelVersion>4.0.0</modelVersion> <artifactId>microservice-monitor-server</artifactId> <dependencies> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-web</artifactId> </dependency> <dependency> <groupId>de.codecentric</groupId> <artifactId>spring-boot-admin-starter-server</artifactId> <version>2.2.0</version> </dependency> <dependency> <groupId>org.springframework.cloud</groupId> <artifactId>spring-cloud-starter-netflix-eureka-client</artifactId> </dependency> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-security</artifactId> </dependency> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-mail</artifactId> </dependency> </dependencies> <build> <plugins> <plugin><groupId>org.springframework.boot</groupId><artifactId>spring-boot-maven-plugin</artifactId> </plugin> </plugins> </build></project>

其中改動(dòng)的只是添加了spring-boot-starter-mail 的依賴(lài)

2、microservice-monitor-server-> application.yml

server: port: 8888spring: application: name: SpringBootAdmin boot: admin: ui: title: SpringBootAdmin-Server notify: mail: from: 123@qq.com to: 345@outlook.com security: user: name: 'admin' password: 'admin' mail: host: smtp.qq.com username: 123@qq.com password: qq #授權(quán)碼 properties: mail: smtp: auth: true starttls: enable: true required: trueeureka: instance: hostname: localhost metadata-map: user.name: ${spring.security.user.name} user.password: ${spring.security.user.password} client: register-with-eureka: true fetch-registry: true serviceUrl: defaultZone: http://localhost:8001/register/eureka/

只需要兩步就配置完成,根本就沒(méi)有編寫(xiě)任何的Java的代碼,只需簡(jiǎn)單的配置就可以了。

三、運(yùn)行測(cè)試

Spring Boot Admin郵件警報(bào)整合過(guò)程解析

Spring Boot Admin郵件警報(bào)整合過(guò)程解析

能夠正常的發(fā)送接收郵件!

以上就是本文的全部?jī)?nèi)容,希望對(duì)大家的學(xué)習(xí)有所幫助,也希望大家多多支持好吧啦網(wǎng)。

標(biāo)簽: Spring
相關(guān)文章:
主站蜘蛛池模板: 五月天六月婷婷 | 久久中文字幕视频 | 欧美一级特黄aa大片在线观看免费 | 在线观看视频一区 | 香蕉视频免费看 | 色综合久久夜色精品国产 | 欧美精品一区二区在线观看 | 久久精品7 | 亚洲啪啪网站 | 欧美三级在线播放 | 免费国产在线观看不卡 | 免费精品精品国产欧美在线 | 女人被男人狂躁下面在线观看 | 欧美亚洲国产精品第一页 | 国产污 | 不卡视频国产 | 人做人爱视频欧美在线观看 | 亚洲毛片免费视频 | 免费一级毛片正在播放 | 高清波多野结衣一区二区三区 | 免费看91视频 | 麻豆视频在线观看免费网站 | 中文字幕最新中文字幕中文字幕 | 一级毛片视频播放 | 美国大片成人性网 | 日韩黄色一级视频 | 亚洲经典激情春色另类 | 老年人一级特黄aa大片 | 精品特级一级毛片免费观看 | 亚洲已满18点击进入在线观看 | 色多多在深夜释放自己黄 | 日本一区二区三区四区无限 | 黄色美女在线观看 | 农村寡妇一级毛片免费看视频 | 国产日比 | 国内成人啪啪网站 | 在线亚洲欧洲福利视频 | 久久国产乱子伦精品岳两 | 久久国产乱子伦精品免费强 | 色片在线免费观看 | 一级特黄性色生活片 |