Search in sources :

Example 1 with RemindingNotifier

use of de.codecentric.boot.admin.notify.RemindingNotifier in project fw-cloud-framework by liuweijw.

the class FwNotifierConfiguration method remindingNotifier.

@Bean
@Primary
public RemindingNotifier remindingNotifier() {
    RemindingNotifier remindingNotifier = new RemindingNotifier(notifier());
    remindingNotifier.setReminderPeriod(TimeUnit.MINUTES.toMillis(1));
    return remindingNotifier;
}
Also used : RemindingNotifier(de.codecentric.boot.admin.notify.RemindingNotifier) Primary(org.springframework.context.annotation.Primary) Bean(org.springframework.context.annotation.Bean)

Example 2 with RemindingNotifier

use of de.codecentric.boot.admin.notify.RemindingNotifier in project micro-service by Lovnx.

the class NotifierConfiguration method remindingNotifier.

@Bean
@Primary
public RemindingNotifier remindingNotifier() {
    RemindingNotifier remindingNotifier = new RemindingNotifier(notifier);
    // 设定时间,5分钟提醒一次
    // remindingNotifier.setReminderPeriod(TimeUnit.MINUTES.toMillis(5));
    // 设定监控服务状态,状态改变为给定值的时候提醒
    remindingNotifier.setReminderStatuses(reminderStatuses);
    return remindingNotifier;
}
Also used : RemindingNotifier(de.codecentric.boot.admin.notify.RemindingNotifier) Primary(com.netflix.governator.annotations.binding.Primary) Bean(org.springframework.context.annotation.Bean)

Example 3 with RemindingNotifier

use of de.codecentric.boot.admin.notify.RemindingNotifier in project tutorials by eugenp.

the class NotifierConfiguration method remindingNotifier.

@Bean
@Primary
public RemindingNotifier remindingNotifier() {
    RemindingNotifier remindingNotifier = new RemindingNotifier(filteringNotifier());
    remindingNotifier.setReminderPeriod(TimeUnit.MINUTES.toMillis(5));
    return remindingNotifier;
}
Also used : RemindingNotifier(de.codecentric.boot.admin.notify.RemindingNotifier) Primary(org.springframework.context.annotation.Primary) Bean(org.springframework.context.annotation.Bean)

Example 4 with RemindingNotifier

use of de.codecentric.boot.admin.notify.RemindingNotifier in project tutorials by eugenp.

the class NotifierConfigurationIntegrationTest method whenApplicationContextStart_ThenRemindingNotifierBeanExists.

@Test
public void whenApplicationContextStart_ThenRemindingNotifierBeanExists() {
    RemindingNotifier remindingNotifier = (RemindingNotifier) applicationContext.getBean("remindingNotifier");
    assertNotEquals(remindingNotifier, null);
}
Also used : RemindingNotifier(de.codecentric.boot.admin.notify.RemindingNotifier) SpringBootTest(org.springframework.boot.test.context.SpringBootTest) Test(org.junit.Test)

Aggregations

RemindingNotifier (de.codecentric.boot.admin.notify.RemindingNotifier)4 Bean (org.springframework.context.annotation.Bean)3 Primary (org.springframework.context.annotation.Primary)2 Primary (com.netflix.governator.annotations.binding.Primary)1 Test (org.junit.Test)1 SpringBootTest (org.springframework.boot.test.context.SpringBootTest)1