Browse Source

增加错误日志

lixing 2 years ago
parent
commit
cddfeb66cb

+ 3 - 0
AlarmEngineStarter/src/main/java/com/persagy/apm/energyalarmstarter/alarmengine/jms/JmsConfig.java

@@ -195,10 +195,13 @@ public class JmsConfig {
             // 根据报警消息获取报警系统
             String alarmCategory = msgHandler.getAlarmCategory(msg);
             if (StringUtils.isBlank(alarmCategory)) {
+                log.error("alarmCategory is blank, message is:{}", msg);
+                channel.basicReject(message.getMessageProperties().getDeliveryTag(), false);
                 return;
             }
             HashSet<String> categorySet = Sets.newHashSet(categoryList);
             if (!categorySet.contains(alarmCategory)) {
+                log.info("message unack, message is: {}", msg);
                 // 如果子系统不能处理此报警系统的消息,将消息扔回消息队列
                 channel.basicNack(message.getMessageProperties().getDeliveryTag(), false, true);
                 return;