diff --git a/hippo4j-example/hippo4j-example-core/src/main/java/cn/hippo4j/example/core/inittest/RunStateHandlerTest.java b/hippo4j-example/hippo4j-example-core/src/main/java/cn/hippo4j/example/core/inittest/RunStateHandlerTest.java index 049d6d51..00c3ed2f 100644 --- a/hippo4j-example/hippo4j-example-core/src/main/java/cn/hippo4j/example/core/inittest/RunStateHandlerTest.java +++ b/hippo4j-example/hippo4j-example-core/src/main/java/cn/hippo4j/example/core/inittest/RunStateHandlerTest.java @@ -18,7 +18,6 @@ package cn.hippo4j.example.core.inittest; import lombok.extern.slf4j.Slf4j; -import org.slf4j.MDC; import org.springframework.stereotype.Component; import javax.annotation.PostConstruct; @@ -29,8 +28,6 @@ import java.util.concurrent.SynchronousQueue; import java.util.concurrent.ThreadPoolExecutor; import java.util.concurrent.TimeUnit; -import static cn.hippo4j.common.constant.Constants.EXECUTE_TIMEOUT_TRACE; - /** * Run state handler test. */ @@ -81,7 +78,7 @@ public class RunStateHandlerTest { /** * When the execution of the thread pool task times out, the Trace flag is put into the MDC, and it is printed out when an alarm occurs. */ - MDC.put(EXECUTE_TIMEOUT_TRACE, "39948722194639841.251.16612352194691531"); + // MDC.put(EXECUTE_TIMEOUT_TRACE, "39948722194639841.251.16612352194691531"); try { Thread.sleep(5000); } catch (InterruptedException e) { diff --git a/hippo4j-message/src/main/java/cn/hippo4j/message/api/NotifyConfigBuilder.java b/hippo4j-message/src/main/java/cn/hippo4j/message/api/NotifyConfigBuilder.java index 74dc94c5..372c5d24 100644 --- a/hippo4j-message/src/main/java/cn/hippo4j/message/api/NotifyConfigBuilder.java +++ b/hippo4j-message/src/main/java/cn/hippo4j/message/api/NotifyConfigBuilder.java @@ -30,7 +30,7 @@ public interface NotifyConfigBuilder { /** * Build notify. * - * @return + * @return notify info */ Map> buildNotify(); } diff --git a/hippo4j-message/src/main/java/cn/hippo4j/message/platform/DingSendMessageHandler.java b/hippo4j-message/src/main/java/cn/hippo4j/message/platform/DingSendMessageHandler.java index ee91e50c..a9b4db2d 100644 --- a/hippo4j-message/src/main/java/cn/hippo4j/message/platform/DingSendMessageHandler.java +++ b/hippo4j-message/src/main/java/cn/hippo4j/message/platform/DingSendMessageHandler.java @@ -60,8 +60,8 @@ public class DingSendMessageHandler extends AbstractRobotSendMessageHandler { RobotMessageActualContent robotMessageActualContent = RobotMessageActualContent.builder() .receiveSeparator(", @") .changeSeparator(" -> ") - .replaceTxt(DING_ALARM_TIMOUT_REPLACE_TXT) - .traceReplaceTxt(DING_ALARM_TIMOUT_TRACE_REPLACE_TXT) + .replaceTxt(DING_ALARM_TIMEOUT_REPLACE_TXT) + .traceReplaceTxt(DING_ALARM_TIMEOUT_TRACE_REPLACE_TXT) .alarmMessageContent(Singleton.get(dingAlarmTxtKey, () -> FileUtil.readUtf8String(dingAlarmTxtKey))) .configMessageContent(Singleton.get(dingConfigTxtKey, () -> FileUtil.readUtf8String(dingConfigTxtKey))) .build(); diff --git a/hippo4j-message/src/main/java/cn/hippo4j/message/platform/LarkSendMessageHandler.java b/hippo4j-message/src/main/java/cn/hippo4j/message/platform/LarkSendMessageHandler.java index 356ea850..99186222 100644 --- a/hippo4j-message/src/main/java/cn/hippo4j/message/platform/LarkSendMessageHandler.java +++ b/hippo4j-message/src/main/java/cn/hippo4j/message/platform/LarkSendMessageHandler.java @@ -55,66 +55,46 @@ public class LarkSendMessageHandler implements SendMessageHandler FileUtil.readUtf8String(larkAlarmTxtKey)); - String larkAlarmTimoutReplaceJsonKey = "message/robot/dynamic-thread-pool/lark-alarm-timeout-replace.json"; - String larkAlarmTimoutReplaceJson = Singleton.get(larkAlarmTimoutReplaceJsonKey, () -> FileUtil.readUtf8String(larkAlarmTimoutReplaceJsonKey)); + String larkAlarmTimeoutReplaceJsonKey = "message/robot/dynamic-thread-pool/lark-alarm-timeout-replace.json"; + String larkAlarmTimeoutReplaceJson = Singleton.get(larkAlarmTimeoutReplaceJsonKey, () -> FileUtil.readUtf8String(larkAlarmTimeoutReplaceJsonKey)); if (Objects.equals(alarmNotifyRequest.getNotifyTypeEnum(), NotifyTypeEnum.TIMEOUT)) { String executeTimeoutTrace = alarmNotifyRequest.getExecuteTimeoutTrace(); String larkAlarmTimoutTraceReplaceJsonKey = "message/robot/dynamic-thread-pool/lark-alarm-trace-replace.json"; String larkAlarmTimoutTraceReplaceJson = Singleton.get(larkAlarmTimoutTraceReplaceJsonKey, () -> FileUtil.readUtf8String(larkAlarmTimoutTraceReplaceJsonKey)); if (StringUtil.isNotBlank(executeTimeoutTrace)) { String larkAlarmTimoutTraceReplaceTxt = String.format(larkAlarmTimoutTraceReplaceJson, executeTimeoutTrace); - larkAlarmTimoutReplaceTxt = StringUtil.replace(larkAlarmTimoutReplaceJson, larkAlarmTimoutTraceReplaceJson, larkAlarmTimoutTraceReplaceTxt); + larkAlarmTimeoutReplaceTxt = StringUtil.replace(larkAlarmTimeoutReplaceJson, larkAlarmTimoutTraceReplaceJson, larkAlarmTimoutTraceReplaceTxt); } else { - larkAlarmTimoutReplaceTxt = StringUtil.replace(larkAlarmTimoutReplaceJson, larkAlarmTimoutTraceReplaceJson, ""); + larkAlarmTimeoutReplaceTxt = StringUtil.replace(larkAlarmTimeoutReplaceJson, larkAlarmTimoutTraceReplaceJson, ""); } - larkAlarmTimoutReplaceTxt = String.format(larkAlarmTimoutReplaceTxt, alarmNotifyRequest.getExecuteTime(), alarmNotifyRequest.getExecuteTimeOut()); - larkAlarmTxt = StringUtil.replace(larkAlarmTxt, larkAlarmTimoutReplaceJson, larkAlarmTimoutReplaceTxt); + larkAlarmTimeoutReplaceTxt = String.format(larkAlarmTimeoutReplaceTxt, alarmNotifyRequest.getExecuteTime(), alarmNotifyRequest.getExecuteTimeOut()); + larkAlarmTxt = StringUtil.replace(larkAlarmTxt, larkAlarmTimeoutReplaceJson, larkAlarmTimeoutReplaceTxt); } else { - larkAlarmTxt = StringUtil.replace(larkAlarmTxt, larkAlarmTimoutReplaceJson, ""); + larkAlarmTxt = StringUtil.replace(larkAlarmTxt, larkAlarmTimeoutReplaceJson, ""); } String text = String.format(larkAlarmTxt, - // 环境 alarmNotifyRequest.getActive(), - // 报警类型 alarmNotifyRequest.getNotifyTypeEnum(), - // 线程池ID alarmNotifyRequest.getThreadPoolId(), - // 应用名称 alarmNotifyRequest.getAppName(), - // 实例信息 alarmNotifyRequest.getIdentify(), - // 核心线程数 alarmNotifyRequest.getCorePoolSize(), - // 最大线程数 alarmNotifyRequest.getMaximumPoolSize(), - // 当前线程数 alarmNotifyRequest.getPoolSize(), - // 活跃线程数 alarmNotifyRequest.getActiveCount(), - // 最大任务数 alarmNotifyRequest.getLargestPoolSize(), - // 线程池任务总量 alarmNotifyRequest.getCompletedTaskCount(), - // 队列类型名称 alarmNotifyRequest.getQueueName(), - // 队列容量 alarmNotifyRequest.getCapacity(), - // 队列元素个数 alarmNotifyRequest.getQueueSize(), - // 队列剩余个数 alarmNotifyRequest.getRemainingCapacity(), - // 拒绝策略名称 alarmNotifyRequest.getRejectedExecutionHandlerName(), - // 拒绝策略次数 alarmNotifyRequest.getRejectCountNum(), - // 告警手机号 afterReceives, - // 当前时间 LocalDateTime.now().format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss")), - // 报警频率 notifyConfig.getInterval()); execute(notifyConfig.getSecretKey(), text); } @@ -127,34 +107,20 @@ public class LarkSendMessageHandler implements SendMessageHandler FileUtil.readUtf8String(larkNoticeJsonKey)); String text = String.format(larkNoticeJson, - // 环境 changeParameterNotifyRequest.getActive(), - // 线程池名称 threadPoolId, - // 应用名称 changeParameterNotifyRequest.getAppName(), - // 实例信息 changeParameterNotifyRequest.getIdentify(), - // 核心线程数 changeParameterNotifyRequest.getBeforeCorePoolSize() + " ➲ " + changeParameterNotifyRequest.getNowCorePoolSize(), - // 最大线程数 changeParameterNotifyRequest.getBeforeMaximumPoolSize() + " ➲ " + changeParameterNotifyRequest.getNowMaximumPoolSize(), - // 核心线程超时 changeParameterNotifyRequest.getBeforeAllowsCoreThreadTimeOut() + " ➲ " + changeParameterNotifyRequest.getNowAllowsCoreThreadTimeOut(), - // 线程存活时间 changeParameterNotifyRequest.getBeforeKeepAliveTime() + " ➲ " + changeParameterNotifyRequest.getNowKeepAliveTime(), - // 阻塞队列 changeParameterNotifyRequest.getBlockingQueueName(), - // 阻塞队列容量 changeParameterNotifyRequest.getBeforeQueueCapacity() + " ➲ " + changeParameterNotifyRequest.getNowQueueCapacity(), - // 执行超时时间 changeParameterNotifyRequest.getBeforeExecuteTimeOut() + " ➲ " + changeParameterNotifyRequest.getNowExecuteTimeOut(), - // 拒绝策略 changeParameterNotifyRequest.getBeforeRejectedName(), changeParameterNotifyRequest.getNowRejectedName(), - // 告警手机号 afterReceives, - // 当前时间 LocalDateTime.now().format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss"))); execute(notifyConfig.getSecretKey(), text); } diff --git a/hippo4j-message/src/main/java/cn/hippo4j/message/platform/base/AbstractRobotSendMessageHandler.java b/hippo4j-message/src/main/java/cn/hippo4j/message/platform/base/AbstractRobotSendMessageHandler.java index 34f7fd71..209c2db9 100644 --- a/hippo4j-message/src/main/java/cn/hippo4j/message/platform/base/AbstractRobotSendMessageHandler.java +++ b/hippo4j-message/src/main/java/cn/hippo4j/message/platform/base/AbstractRobotSendMessageHandler.java @@ -37,22 +37,22 @@ public abstract class AbstractRobotSendMessageHandler implements SendMessageHand /** * Build message actual content. * - * @return + * @return robot message actual content */ protected abstract RobotMessageActualContent buildMessageActualContent(); /** * Execute. * - * @param robotMessageExecuteDTO + * @param robotMessageExecuteDTO robot message execute dto */ protected abstract void execute(RobotMessageExecuteDTO robotMessageExecuteDTO); /** * Send alarm message. * - * @param notifyConfig - * @param alarmNotifyRequest + * @param notifyConfig notify config + * @param alarmNotifyRequest alarm notify request */ public void sendAlarmMessage(NotifyConfigDTO notifyConfig, AlarmNotifyRequest alarmNotifyRequest) { RobotMessageActualContent robotMessageActualContent = buildMessageActualContent(); @@ -75,45 +75,25 @@ public abstract class AbstractRobotSendMessageHandler implements SendMessageHand alarmContentTxt = StringUtil.replace(alarmContentTxt, "${timout-content}", replaceTxt); String text = String.format( alarmContentTxt, - // 环境 alarmNotifyRequest.getActive(), - // 报警类型 alarmNotifyRequest.getNotifyTypeEnum(), - // 线程池ID alarmNotifyRequest.getThreadPoolId(), - // 应用名称 alarmNotifyRequest.getAppName(), - // 实例信息 alarmNotifyRequest.getIdentify(), - // 核心线程数 alarmNotifyRequest.getCorePoolSize(), - // 最大线程数 alarmNotifyRequest.getMaximumPoolSize(), - // 当前线程数 alarmNotifyRequest.getPoolSize(), - // 活跃线程数 alarmNotifyRequest.getActiveCount(), - // 最大任务数 alarmNotifyRequest.getLargestPoolSize(), - // 线程池任务总量 alarmNotifyRequest.getCompletedTaskCount(), - // 队列类型名称 alarmNotifyRequest.getQueueName(), - // 队列容量 alarmNotifyRequest.getCapacity(), - // 队列元素个数 alarmNotifyRequest.getQueueSize(), - // 队列剩余个数 alarmNotifyRequest.getRemainingCapacity(), - // 拒绝策略名称 alarmNotifyRequest.getRejectedExecutionHandlerName(), - // 拒绝策略次数 alarmNotifyRequest.getRejectCountNum(), - // 告警手机号 Joiner.on(robotMessageActualContent.getReceiveSeparator()).join(notifyConfig.getReceives().split(",")), - // 报警频率 notifyConfig.getInterval(), - // 当前时间 LocalDateTime.now().format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss"))); execute(RobotMessageExecuteDTO.builder().text(text).notifyConfig(notifyConfig).build()); } @@ -121,8 +101,8 @@ public abstract class AbstractRobotSendMessageHandler implements SendMessageHand /** * Send change message. * - * @param notifyConfig - * @param changeParameterNotifyRequest + * @param notifyConfig notify config + * @param changeParameterNotifyRequest change parameter notify request */ public void sendChangeMessage(NotifyConfigDTO notifyConfig, ChangeParameterNotifyRequest changeParameterNotifyRequest) { RobotMessageActualContent robotMessageActualContent = buildMessageActualContent(); @@ -130,34 +110,20 @@ public abstract class AbstractRobotSendMessageHandler implements SendMessageHand String changeSeparator = robotMessageActualContent.getChangeSeparator(); String text = String.format( robotMessageActualContent.getConfigMessageContent(), - // 环境 changeParameterNotifyRequest.getActive(), - // 线程池名称 threadPoolId, - // 应用名称 changeParameterNotifyRequest.getAppName(), - // 实例信息 changeParameterNotifyRequest.getIdentify(), - // 核心线程数 changeParameterNotifyRequest.getBeforeCorePoolSize() + changeSeparator + changeParameterNotifyRequest.getNowCorePoolSize(), - // 最大线程数 changeParameterNotifyRequest.getBeforeMaximumPoolSize() + changeSeparator + changeParameterNotifyRequest.getNowMaximumPoolSize(), - // 核心线程超时 changeParameterNotifyRequest.getBeforeAllowsCoreThreadTimeOut() + changeSeparator + changeParameterNotifyRequest.getNowAllowsCoreThreadTimeOut(), - // 线程存活时间 changeParameterNotifyRequest.getBeforeKeepAliveTime() + changeSeparator + changeParameterNotifyRequest.getNowKeepAliveTime(), - // 执行超时时间 changeParameterNotifyRequest.getBeforeExecuteTimeOut() + changeSeparator + changeParameterNotifyRequest.getNowExecuteTimeOut(), - // 阻塞队列 changeParameterNotifyRequest.getBlockingQueueName(), - // 阻塞队列容量 changeParameterNotifyRequest.getBeforeQueueCapacity() + changeSeparator + changeParameterNotifyRequest.getNowQueueCapacity(), - // 拒绝策略 changeParameterNotifyRequest.getBeforeRejectedName(), changeParameterNotifyRequest.getNowRejectedName(), - // 告警手机号 Joiner.on(robotMessageActualContent.getReceiveSeparator()).join(notifyConfig.getReceives().split(",")), - // 当前时间 LocalDateTime.now().format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss"))); execute(RobotMessageExecuteDTO.builder().text(text).notifyConfig(notifyConfig).build()); } diff --git a/hippo4j-message/src/main/java/cn/hippo4j/message/platform/constant/DingAlarmConstants.java b/hippo4j-message/src/main/java/cn/hippo4j/message/platform/constant/DingAlarmConstants.java index 9688fe98..f8505403 100644 --- a/hippo4j-message/src/main/java/cn/hippo4j/message/platform/constant/DingAlarmConstants.java +++ b/hippo4j-message/src/main/java/cn/hippo4j/message/platform/constant/DingAlarmConstants.java @@ -40,14 +40,14 @@ public class DingAlarmConstants { /** * Trace info */ - public static final String DING_ALARM_TIMOUT_TRACE_REPLACE_TXT = "链路信息:%s \n\n "; + public static final String DING_ALARM_TIMEOUT_TRACE_REPLACE_TXT = "链路信息:%s \n\n "; /** * Replace task timeout template */ - public static final String DING_ALARM_TIMOUT_REPLACE_TXT = + public static final String DING_ALARM_TIMEOUT_REPLACE_TXT = "任务执行时间:%d / ms \n\n " + "超时时间:%d / ms \n\n " + - DING_ALARM_TIMOUT_TRACE_REPLACE_TXT + + DING_ALARM_TIMEOUT_TRACE_REPLACE_TXT + " --- \n\n "; } diff --git a/hippo4j-message/src/main/java/cn/hippo4j/message/service/AlarmControlHandler.java b/hippo4j-message/src/main/java/cn/hippo4j/message/service/AlarmControlHandler.java index 96eae6ab..ea86e0f2 100644 --- a/hippo4j-message/src/main/java/cn/hippo4j/message/service/AlarmControlHandler.java +++ b/hippo4j-message/src/main/java/cn/hippo4j/message/service/AlarmControlHandler.java @@ -17,12 +17,6 @@ package cn.hippo4j.message.service; -import java.util.HashMap; -import java.util.Map; -import java.util.concurrent.ConcurrentHashMap; -import java.util.concurrent.TimeUnit; -import java.util.concurrent.locks.ReentrantLock; - import cn.hippo4j.common.constant.Constants; import cn.hippo4j.common.toolkit.IdUtil; import cn.hippo4j.common.toolkit.StringUtil; @@ -30,6 +24,12 @@ import cn.hippo4j.message.dto.AlarmControlDTO; import com.github.benmanes.caffeine.cache.Cache; import com.github.benmanes.caffeine.cache.Caffeine; +import java.util.HashMap; +import java.util.Map; +import java.util.concurrent.ConcurrentHashMap; +import java.util.concurrent.TimeUnit; +import java.util.concurrent.locks.ReentrantLock; + /** * Alarm control assembly. */ @@ -42,8 +42,8 @@ public class AlarmControlHandler { /** * Control message push alarm frequency. * - * @param alarmControl - * @return + * @param alarmControl alarm control + * @return is it possible to send */ public boolean isSendAlarm(AlarmControlDTO alarmControl) { String threadPoolKey = alarmControl.buildPk(); @@ -72,9 +72,9 @@ public class AlarmControlHandler { /** * Init cache and lock. * - * @param threadPoolId - * @param platform - * @param interval + * @param threadPoolId thread-pool id + * @param platform platform + * @param interval interval */ public void initCacheAndLock(String threadPoolId, String platform, Integer interval) { String threadPoolKey = threadPoolId + Constants.GROUP_KEY_DELIMITER + platform; diff --git a/hippo4j-message/src/main/java/cn/hippo4j/message/service/Hippo4jBaseSendMessageService.java b/hippo4j-message/src/main/java/cn/hippo4j/message/service/Hippo4jBaseSendMessageService.java index ca7af719..2f5eedbd 100644 --- a/hippo4j-message/src/main/java/cn/hippo4j/message/service/Hippo4jBaseSendMessageService.java +++ b/hippo4j-message/src/main/java/cn/hippo4j/message/service/Hippo4jBaseSendMessageService.java @@ -109,9 +109,9 @@ public class Hippo4jBaseSendMessageService implements Hippo4jSendMessageService, /** * Is send alarm. * - * @param threadPoolId - * @param platform - * @param typeEnum + * @param threadPoolId thread-pool id + * @param platform platform + * @param typeEnum type enum * @return */ private boolean isSendAlarm(String threadPoolId, String platform, NotifyTypeEnum typeEnum) { @@ -123,6 +123,15 @@ public class Hippo4jBaseSendMessageService implements Hippo4jSendMessageService, return alarmControlHandler.isSendAlarm(alarmControl); } + /** + * Put platform. + * + * @param notifyConfigs notify configs + */ + public synchronized void putPlatform(Map> notifyConfigs) { + this.notifyConfigs.putAll(notifyConfigs); + } + @Override public void run(String... args) throws Exception { Map sendMessageHandlerMap = @@ -131,13 +140,4 @@ public class Hippo4jBaseSendMessageService implements Hippo4jSendMessageService, Map> buildNotify = notifyConfigBuilder.buildNotify(); notifyConfigs.putAll(buildNotify); } - - /** - * Put platform. - * - * @param notifyConfigs - */ - public synchronized void putPlatform(Map> notifyConfigs) { - this.notifyConfigs.putAll(notifyConfigs); - } } diff --git a/hippo4j-message/src/main/java/cn/hippo4j/message/service/Hippo4jSendMessageService.java b/hippo4j-message/src/main/java/cn/hippo4j/message/service/Hippo4jSendMessageService.java index f3ef3445..52a63ecc 100644 --- a/hippo4j-message/src/main/java/cn/hippo4j/message/service/Hippo4jSendMessageService.java +++ b/hippo4j-message/src/main/java/cn/hippo4j/message/service/Hippo4jSendMessageService.java @@ -29,15 +29,15 @@ public interface Hippo4jSendMessageService { /** * Send dynamic thread pool alert notifications. * - * @param typeEnum - * @param alarmNotifyRequest + * @param typeEnum type enum + * @param alarmNotifyRequest alarm notify request */ void sendAlarmMessage(NotifyTypeEnum typeEnum, AlarmNotifyRequest alarmNotifyRequest); /** * Send dynamic thread pool parameter change notification. * - * @param changeParameterNotifyRequest + * @param changeParameterNotifyRequest change parameter notify request */ void sendChangeMessage(ChangeParameterNotifyRequest changeParameterNotifyRequest); } diff --git a/hippo4j-message/src/main/java/cn/hippo4j/message/service/SendMessageHandler.java b/hippo4j-message/src/main/java/cn/hippo4j/message/service/SendMessageHandler.java index ecdfa7eb..9e61f362 100644 --- a/hippo4j-message/src/main/java/cn/hippo4j/message/service/SendMessageHandler.java +++ b/hippo4j-message/src/main/java/cn/hippo4j/message/service/SendMessageHandler.java @@ -26,25 +26,25 @@ import cn.hippo4j.message.request.base.NotifyRequest; public interface SendMessageHandler { /** - * Get type. + * Get the message send type. * - * @return + * @return message type */ String getType(); /** * Send alarm message. * - * @param notifyConfig - * @param alarmNotifyRequest + * @param notifyConfig notify config + * @param alarmNotifyRequest alarm notify request */ void sendAlarmMessage(NotifyConfigDTO notifyConfig, T alarmNotifyRequest); /** * Send change message. * - * @param notifyConfig - * @param changeParameterNotifyRequest + * @param notifyConfig notify config + * @param changeParameterNotifyRequest change parameter notify request */ void sendChangeMessage(NotifyConfigDTO notifyConfig, R changeParameterNotifyRequest); } diff --git a/hippo4j-message/src/main/resources/message/robot/dynamic-thread-pool/lark-alarm-timeout-replace.json b/hippo4j-message/src/main/resources/message/robot/dynamic-thread-pool/lark-alarm-timeout-replace.json index 14d038b4..fcc575fc 100644 --- a/hippo4j-message/src/main/resources/message/robot/dynamic-thread-pool/lark-alarm-timeout-replace.json +++ b/hippo4j-message/src/main/resources/message/robot/dynamic-thread-pool/lark-alarm-timeout-replace.json @@ -14,8 +14,8 @@ "content": "** 超时时间:** %s", "tag": "lark_md" } - }, - { + } + ,{ "is_short": true, "text": { "content": "** 链路信息:** %s", diff --git a/hippo4j-message/src/main/resources/message/robot/dynamic-thread-pool/lark-alarm-trace-replace.json b/hippo4j-message/src/main/resources/message/robot/dynamic-thread-pool/lark-alarm-trace-replace.json index 9f95a8b6..55223916 100644 --- a/hippo4j-message/src/main/resources/message/robot/dynamic-thread-pool/lark-alarm-trace-replace.json +++ b/hippo4j-message/src/main/resources/message/robot/dynamic-thread-pool/lark-alarm-trace-replace.json @@ -1,5 +1,5 @@ - { + ,{ "is_short": true, "text": { "content": "** 链路信息:** %s", diff --git a/hippo4j-message/src/main/resources/message/robot/dynamic-thread-pool/lark-alarm.json b/hippo4j-message/src/main/resources/message/robot/dynamic-thread-pool/lark-alarm.json index 1c60f9a5..0e451e93 100644 --- a/hippo4j-message/src/main/resources/message/robot/dynamic-thread-pool/lark-alarm.json +++ b/hippo4j-message/src/main/resources/message/robot/dynamic-thread-pool/lark-alarm.json @@ -142,8 +142,8 @@ "content": "** 超时时间:** %s", "tag": "lark_md" } - }, - { + } + ,{ "is_short": true, "text": { "content": "** 链路信息:** %s", diff --git a/hippo4j-message/src/test/java/cn/hippo4j/message/service/AlarmControlHandlerTest.java b/hippo4j-message/src/test/java/cn/hippo4j/message/service/AlarmControlHandlerTest.java index e388b209..e7b22bae 100644 --- a/hippo4j-message/src/test/java/cn/hippo4j/message/service/AlarmControlHandlerTest.java +++ b/hippo4j-message/src/test/java/cn/hippo4j/message/service/AlarmControlHandlerTest.java @@ -22,7 +22,7 @@ import cn.hippo4j.message.enums.NotifyTypeEnum; import org.junit.Assert; import org.junit.Test; -public class AlarmControlHandlerTest { +public final class AlarmControlHandlerTest { @Test public void assertIsNotSendAlarm() {