Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
S
spring-boot-admin
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
openSource
spring-boot-admin
Commits
358b1b0b
Commit
358b1b0b
authored
Jul 25, 2018
by
赵天增
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
发送邮件
parent
94c05446
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
43 additions
and
2 deletions
+43
-2
pom.xml
monitor-core/pom.xml
+4
-0
NotifierConfiguration.java
.../java/com/medtap/monitor/admin/NotifierConfiguration.java
+33
-0
application.yml
monitor-core/src/main/resources/application.yml
+5
-1
SpringBootAdminApplication.java
...de/codecentric/boot/admin/SpringBootAdminApplication.java
+1
-1
No files found.
monitor-core/pom.xml
View file @
358b1b0b
...
@@ -32,6 +32,10 @@
...
@@ -32,6 +32,10 @@
<version>
1.0.0-SNAPSHOT
</version>
<version>
1.0.0-SNAPSHOT
</version>
</dependency>
</dependency>
<dependency>
<dependency>
<groupId>
org.springframework.boot
</groupId>
<artifactId>
spring-boot-starter-mail
</artifactId>
</dependency>
<dependency>
<groupId>
de.codecentric
</groupId>
<groupId>
de.codecentric
</groupId>
<artifactId>
spring-boot-admin-starter-server
</artifactId>
<artifactId>
spring-boot-admin-starter-server
</artifactId>
<version>
2.0.2-SNAPSHOT
</version>
<version>
2.0.2-SNAPSHOT
</version>
...
...
monitor-core/src/main/java/com/medtap/monitor/admin/NotifierConfiguration.java
0 → 100644
View file @
358b1b0b
//package com.medtap.monitor.admin;
//
//import de.codecentric.boot.admin.server.domain.entities.InstanceRepository;
//import de.codecentric.boot.admin.server.notify.CompositeNotifier;
//import de.codecentric.boot.admin.server.notify.MailNotifier;
//import de.codecentric.boot.admin.server.notify.Notifier;
//import de.codecentric.boot.admin.server.notify.RemindingNotifier;
//import de.codecentric.boot.admin.server.notify.filter.FilteringNotifier;
//import org.springframework.beans.factory.ObjectProvider;
//import org.springframework.beans.factory.annotation.Autowired;
//import org.springframework.context.annotation.Bean;
//import org.springframework.context.annotation.Configuration;
//import org.springframework.context.annotation.Primary;
//
//import java.time.Duration;
//import java.util.Collections;
//import java.util.List;
//
//@Configuration
//public class NotifierConfiguration {
// private final InstanceRepository repository;
// private final ObjectProvider<List<Notifier>> otherNotifiers;
//
//
// @Primary
// @Bean(initMethod = "start", destroyMethod = "stop")
// public RemindingNotifier remindingNotifier() {
// RemindingNotifier notifier = new RemindingNotifier(filteringNotifier(), repository);
// notifier.setReminderPeriod(Duration.ofSeconds(10));
// notifier.setCheckReminderInverval(Duration.ofSeconds(10));
// return notifier;
// }
//}
monitor-core/src/main/resources/application.yml
View file @
358b1b0b
...
@@ -19,6 +19,10 @@ management:
...
@@ -19,6 +19,10 @@ management:
# 微服务列表,如果服务不存在会触发邮件提醒
# 微服务列表,如果服务不存在会触发邮件提醒
spring
:
spring
:
mail
:
host
:
smtp.medtap.cn
password
:
webmaster@123
username
:
webmaster@medtap.cn
security
:
security
:
user
:
user
:
name
:
"
server-monitor"
name
:
"
server-monitor"
...
@@ -29,7 +33,7 @@ spring:
...
@@ -29,7 +33,7 @@ spring:
mail
:
mail
:
enabled
:
true
enabled
:
true
to
:
tianzeng.zhao@medtap.cn
to
:
tianzeng.zhao@medtap.cn
from
:
tianzeng.zhao
@medtap.cn
from
:
webmaster
@medtap.cn
services
:
services
:
GATEWAY-CORE,
GATEWAY-CORE,
ITEM-API,
ITEM-API,
...
...
spring-boot-admin-samples/spring-boot-admin-sample-servlet/src/main/java/de/codecentric/boot/admin/SpringBootAdminApplication.java
View file @
358b1b0b
...
@@ -161,7 +161,7 @@ public class SpringBootAdminApplication {
...
@@ -161,7 +161,7 @@ public class SpringBootAdminApplication {
@Bean
(
initMethod
=
"start"
,
destroyMethod
=
"stop"
)
@Bean
(
initMethod
=
"start"
,
destroyMethod
=
"stop"
)
public
RemindingNotifier
remindingNotifier
()
{
// <2>
public
RemindingNotifier
remindingNotifier
()
{
// <2>
RemindingNotifier
notifier
=
new
RemindingNotifier
(
filteringNotifier
(),
repository
);
RemindingNotifier
notifier
=
new
RemindingNotifier
(
filteringNotifier
(),
repository
);
notifier
.
setReminderPeriod
(
Duration
.
of
Minute
s
(
10
));
notifier
.
setReminderPeriod
(
Duration
.
of
Second
s
(
10
));
notifier
.
setCheckReminderInverval
(
Duration
.
ofSeconds
(
10
));
notifier
.
setCheckReminderInverval
(
Duration
.
ofSeconds
(
10
));
return
notifier
;
return
notifier
;
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment