From e7463532960313f488f184ccc1c87c57406c18be Mon Sep 17 00:00:00 2001 From: weihu Date: Tue, 22 Mar 2022 14:17:48 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E7=A9=BA=E6=8C=87=E9=92=88?= =?UTF-8?q?=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../hippo4j/core/starter/config/ExecutorProperties.java | 8 ++++++++ .../core/starter/notify/CoreNotifyConfigBuilder.java | 4 ++-- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/hippo4j-spring-boot/hippo4j-core-spring-boot-starter/src/main/java/cn/hippo4j/core/starter/config/ExecutorProperties.java b/hippo4j-spring-boot/hippo4j-core-spring-boot-starter/src/main/java/cn/hippo4j/core/starter/config/ExecutorProperties.java index 29b283c5..dd38e86f 100644 --- a/hippo4j-spring-boot/hippo4j-core-spring-boot-starter/src/main/java/cn/hippo4j/core/starter/config/ExecutorProperties.java +++ b/hippo4j-spring-boot/hippo4j-core-spring-boot-starter/src/main/java/cn/hippo4j/core/starter/config/ExecutorProperties.java @@ -1,9 +1,12 @@ package cn.hippo4j.core.starter.config; import cn.hippo4j.common.notify.ThreadPoolNotifyAlarm; +import com.google.common.collect.Maps; import lombok.Data; import lombok.experimental.Accessors; +import java.util.Map; + /** * Executor properties. * @@ -69,4 +72,9 @@ public class ExecutorProperties { */ private ThreadPoolNotifyAlarm notify; + + public Map receives() { + return this.notify.getReceives() == null ? Maps.newHashMap() : this.notify.getReceives(); + } + } diff --git a/hippo4j-spring-boot/hippo4j-core-spring-boot-starter/src/main/java/cn/hippo4j/core/starter/notify/CoreNotifyConfigBuilder.java b/hippo4j-spring-boot/hippo4j-core-spring-boot-starter/src/main/java/cn/hippo4j/core/starter/notify/CoreNotifyConfigBuilder.java index 54d7f403..c2df4324 100644 --- a/hippo4j-spring-boot/hippo4j-core-spring-boot-starter/src/main/java/cn/hippo4j/core/starter/notify/CoreNotifyConfigBuilder.java +++ b/hippo4j-spring-boot/hippo4j-core-spring-boot-starter/src/main/java/cn/hippo4j/core/starter/notify/CoreNotifyConfigBuilder.java @@ -61,7 +61,7 @@ public class CoreNotifyConfigBuilder implements NotifyConfigBuilder { notifyConfig.setType("ALARM"); notifyConfig.setSecretKey(platformProperties.getSecretKey()); notifyConfig.setInterval(executor.getNotify().getInterval()); - Map receives = executor.getNotify().getReceives(); + Map receives = executor.receives(); String receive = receives.get(platformProperties.getPlatform()); if (StrUtil.isBlank(receive)) { receive = platformProperties.getReceives(); @@ -82,7 +82,7 @@ public class CoreNotifyConfigBuilder implements NotifyConfigBuilder { notifyConfig.setType("CONFIG"); notifyConfig.setSecretKey(platformProperties.getSecretKey()); - Map receives = executor.getNotify().getReceives(); + Map receives = executor.receives(); String receive = receives.get(platformProperties.getPlatform()); if (StrUtil.isBlank(receive)) { receive = platformProperties.getReceives();