Commit d3027b066831437e18ce42ce7d8f0b3d428c4893

Authored by 648540858
1 parent 22a205e8

优化消息通道

src/main/java/com/genersoft/iot/vmp/gb28181/transmit/event/request/impl/message/notify/cmd/AlarmNotifyMessageHandler.java
... ... @@ -269,12 +269,15 @@ public class AlarmNotifyMessageHandler extends SIPRequestProcessorParent impleme
269 269 if (channelId.equals(parentPlatform.getDeviceGBId())) {
270 270 // 发送给平台的报警信息。 发送redis通知
271 271 AlarmChannelMessage alarmChannelMessage = new AlarmChannelMessage();
272   - alarmChannelMessage.setAlarmSn(Integer.parseInt(deviceAlarm.getAlarmMethod()));
  272 + if (deviceAlarm.getAlarmMethod() != null) {
  273 + alarmChannelMessage.setAlarmSn(Integer.parseInt(deviceAlarm.getAlarmMethod()));
  274 + }
273 275 alarmChannelMessage.setAlarmDescription(deviceAlarm.getAlarmDescription());
274 276 alarmChannelMessage.setGbId(channelId);
275   - alarmChannelMessage.setAlarmType(Integer.parseInt(deviceAlarm.getAlarmType()));
  277 + if (deviceAlarm.getAlarmType() != null) {
  278 + alarmChannelMessage.setAlarmType(Integer.parseInt(deviceAlarm.getAlarmType()));
  279 + }
276 280 redisCatchStorage.sendAlarmMsg(alarmChannelMessage);
277   - return;
278 281 }
279 282 }
280 283 }
... ...
src/main/java/com/genersoft/iot/vmp/storager/impl/RedisCatchStorageImpl.java
... ... @@ -857,7 +857,7 @@ public class RedisCatchStorageImpl implements IRedisCatchStorage {
857 857  
858 858 @Override
859 859 public void sendAlarmMsg(AlarmChannelMessage msg) {
860   - String key = VideoManagerConstants.VM_MSG_SUBSCRIBE_ALARM_RECEIVE;
  860 + String key = VideoManagerConstants.VM_MSG_SUBSCRIBE_ALARM;
861 861 logger.info("[redis发送通知] 报警{}: {}", key, JSON.toJSON(msg));
862 862 RedisUtil.convertAndSend(key, (JSONObject)JSON.toJSON(msg));
863 863 }
... ...