From c3ce2bc5d069ba57309567aee4ae418bc0cf75ed Mon Sep 17 00:00:00 2001 From: 648540858 <648540858@qq.com> Date: 星期五, 17 三月 2023 13:22:05 +0800 Subject: [PATCH] 优化异常处理以及级联设备状态查询 --- src/main/java/com/genersoft/iot/vmp/gb28181/transmit/event/request/impl/message/response/cmd/MobilePositionResponseMessageHandler.java | 2 src/main/java/com/genersoft/iot/vmp/gb28181/transmit/event/request/impl/message/notify/cmd/MobilePositionNotifyMessageHandler.java | 5 src/main/java/com/genersoft/iot/vmp/gb28181/transmit/cmd/impl/SIPCommander.java | 2 src/main/java/com/genersoft/iot/vmp/media/zlm/ZLMRTPServerFactory.java | 2 src/main/java/com/genersoft/iot/vmp/common/StreamInfo.java | 2 src/main/java/com/genersoft/iot/vmp/gb28181/transmit/event/request/impl/message/notify/cmd/AlarmNotifyMessageHandler.java | 9 + src/main/java/com/genersoft/iot/vmp/service/redisMsg/RedisGpsMsgListener.java | 3 src/main/java/com/genersoft/iot/vmp/gb28181/transmit/event/request/impl/message/response/cmd/RecordInfoResponseMessageHandler.java | 3 src/main/java/com/genersoft/iot/vmp/service/redisMsg/RedisPushStreamStatusListMsgListener.java | 3 src/main/java/com/genersoft/iot/vmp/gb28181/transmit/event/request/impl/SubscribeRequestProcessor.java | 6 src/main/java/com/genersoft/iot/vmp/service/redisMsg/RedisAlarmMsgListener.java | 3 src/main/java/com/genersoft/iot/vmp/gb28181/transmit/event/request/SIPRequestProcessorParent.java | 4 src/main/java/com/genersoft/iot/vmp/storager/impl/VideoManagerStorageImpl.java | 4 src/main/java/com/genersoft/iot/vmp/service/redisMsg/RedisGbPlayMsgListener.java | 3 web_src/src/components/dialog/platformEdit.vue | 2 src/main/java/com/genersoft/iot/vmp/gb28181/transmit/event/request/impl/message/query/cmd/DeviceInfoQueryMessageHandler.java | 17 +++- src/main/java/com/genersoft/iot/vmp/service/redisMsg/RedisPushStreamStatusMsgListener.java | 3 src/main/java/com/genersoft/iot/vmp/vmanager/streamPush/StreamPushController.java | 2 src/main/java/com/genersoft/iot/vmp/service/redisMsg/RedisPushStreamResponseListener.java | 3 src/main/java/com/genersoft/iot/vmp/service/redisMsg/RedisStreamMsgListener.java | 3 src/main/java/com/genersoft/iot/vmp/gb28181/transmit/event/request/impl/RegisterRequestProcessor.java | 2 src/main/java/com/genersoft/iot/vmp/utils/redis/RedisUtil.java | 52 ++++++------ src/main/java/com/genersoft/iot/vmp/gb28181/transmit/event/request/impl/message/response/cmd/CatalogResponseMessageHandler.java | 3 src/main/java/com/genersoft/iot/vmp/gb28181/transmit/event/request/impl/InviteRequestProcessor.java | 36 ++++----- src/main/java/com/genersoft/iot/vmp/gb28181/transmit/cmd/impl/SIPCommanderFroPlatform.java | 22 ++++- src/main/java/com/genersoft/iot/vmp/gb28181/transmit/event/request/impl/NotifyRequestProcessor.java | 8 +- src/main/java/com/genersoft/iot/vmp/service/impl/StreamProxyServiceImpl.java | 2 27 files changed, 117 insertions(+), 89 deletions(-) diff --git a/src/main/java/com/genersoft/iot/vmp/common/StreamInfo.java b/src/main/java/com/genersoft/iot/vmp/common/StreamInfo.java index 8311745..42ff5ba 100644 --- a/src/main/java/com/genersoft/iot/vmp/common/StreamInfo.java +++ b/src/main/java/com/genersoft/iot/vmp/common/StreamInfo.java @@ -520,7 +520,7 @@ try{ instance = (StreamInfo)super.clone(); }catch(CloneNotSupportedException e) { - e.printStackTrace(); + logger.error("鏈鐞嗙殑寮傚父 ", e); } return instance; } diff --git a/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/cmd/impl/SIPCommander.java b/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/cmd/impl/SIPCommander.java index ecd2320..8a55cce 100644 --- a/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/cmd/impl/SIPCommander.java +++ b/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/cmd/impl/SIPCommander.java @@ -937,8 +937,6 @@ catalogXml.append("<DeviceID>" + device.getDeviceId() + "</DeviceID>\r\n"); catalogXml.append("</Query>\r\n"); - - Request request = headerProvider.createMessageRequest(device, catalogXml.toString(), null, SipUtils.getNewFromTag(), null,sipSender.getNewCallIdHeader(sipLayer.getLocalIp(device.getLocalIp()),device.getTransport())); sipSender.transmitRequest(sipLayer.getLocalIp(device.getLocalIp()), request, errorEvent); diff --git a/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/cmd/impl/SIPCommanderFroPlatform.java b/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/cmd/impl/SIPCommanderFroPlatform.java index 9685935..dc5c31a 100644 --- a/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/cmd/impl/SIPCommanderFroPlatform.java +++ b/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/cmd/impl/SIPCommanderFroPlatform.java @@ -16,6 +16,7 @@ import com.genersoft.iot.vmp.storager.IRedisCatchStorage; import com.genersoft.iot.vmp.storager.dao.dto.PlatformRegisterInfo; import com.genersoft.iot.vmp.utils.DateUtil; +import com.genersoft.iot.vmp.utils.GitUtil; import gov.nist.javax.sip.message.MessageFactoryImpl; import gov.nist.javax.sip.message.SIPRequest; import org.slf4j.Logger; @@ -64,6 +65,9 @@ @Autowired private DynamicTask dynamicTask; + + @Autowired + private GitUtil gitUtil; @Override public void register(ParentPlatform parentPlatform, SipSubscribe.Event errorEvent , SipSubscribe.Event okEvent) throws InvalidArgumentException, ParseException, SipException { @@ -266,6 +270,9 @@ String callId = request.getCallIdHeader().getCallId(); + logger.info("[鍛戒护鍙戦�乚 鍥芥爣绾ц仈{} 鐩綍鏌ヨ鍥炲: 鍏眥}鏉★紝宸插彂閫亄}鏉�", parentPlatform.getServerGBId(), + channels.size(), Math.min(index + parentPlatform.getCatalogGroup(), channels.size())); + logger.debug(catalogXml); if (sendAfterResponse) { // 榛樿鎸夌収鏀跺埌200鍥炲鍚庡彂閫佷笅涓�鏉★紝 濡傛灉瓒呮椂鏀朵笉鍒板洖澶嶏紝灏变互30姣鐨勯棿闅旂洿鎺ュ彂閫併�� dynamicTask.startDelay(timeoutTaskKey, ()->{ @@ -317,17 +324,22 @@ if (parentPlatform == null) { return; } + String deviceId = device == null ? parentPlatform.getDeviceGBId() : device.getDeviceId(); + String deviceName = device == null ? parentPlatform.getName() : device.getName(); + String manufacturer = device == null ? "WVP-28181-PRO" : device.getManufacturer(); + String model = device == null ? "platform" : device.getModel(); + String firmware = device == null ? gitUtil.getBuildVersion() : device.getFirmware(); String characterSet = parentPlatform.getCharacterSet(); StringBuffer deviceInfoXml = new StringBuffer(600); deviceInfoXml.append("<?xml version=\"1.0\" encoding=\"" + characterSet + "\"?>\r\n"); deviceInfoXml.append("<Response>\r\n"); deviceInfoXml.append("<CmdType>DeviceInfo</CmdType>\r\n"); deviceInfoXml.append("<SN>" +sn + "</SN>\r\n"); - deviceInfoXml.append("<DeviceID>" + device.getDeviceId() + "</DeviceID>\r\n"); - deviceInfoXml.append("<DeviceName>" + device.getName() + "</DeviceName>\r\n"); - deviceInfoXml.append("<Manufacturer>" + device.getManufacturer() + "</Manufacturer>\r\n"); - deviceInfoXml.append("<Model>" + device.getModel() + "</Model>\r\n"); - deviceInfoXml.append("<Firmware>" + device.getFirmware() + "</Firmware>\r\n"); + deviceInfoXml.append("<DeviceID>" + deviceId + "</DeviceID>\r\n"); + deviceInfoXml.append("<DeviceName>" + deviceName + "</DeviceName>\r\n"); + deviceInfoXml.append("<Manufacturer>" + manufacturer + "</Manufacturer>\r\n"); + deviceInfoXml.append("<Model>" + model + "</Model>\r\n"); + deviceInfoXml.append("<Firmware>" + firmware + "</Firmware>\r\n"); deviceInfoXml.append("<Result>OK</Result>\r\n"); deviceInfoXml.append("</Response>\r\n"); diff --git a/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/event/request/SIPRequestProcessorParent.java b/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/event/request/SIPRequestProcessorParent.java index 55c98fe..0a7eb2c 100644 --- a/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/event/request/SIPRequestProcessorParent.java +++ b/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/event/request/SIPRequestProcessorParent.java @@ -45,7 +45,7 @@ try { return SipFactory.getInstance().createHeaderFactory(); } catch (PeerUnavailableException e) { - e.printStackTrace(); + logger.error("鏈鐞嗙殑寮傚父 ", e); } return null; } @@ -54,7 +54,7 @@ try { return SipFactory.getInstance().createMessageFactory(); } catch (PeerUnavailableException e) { - e.printStackTrace(); + logger.error("鏈鐞嗙殑寮傚父 ", e); } return null; } diff --git a/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/event/request/impl/InviteRequestProcessor.java b/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/event/request/impl/InviteRequestProcessor.java index fd9e0c6..1a6358b 100644 --- a/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/event/request/impl/InviteRequestProcessor.java +++ b/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/event/request/impl/InviteRequestProcessor.java @@ -406,12 +406,8 @@ }, 60 * 1000); responseSdpAck(request, content.toString(), platform); - } catch (SipException e) { - e.printStackTrace(); - } catch (InvalidArgumentException e) { - e.printStackTrace(); - } catch (ParseException e) { - e.printStackTrace(); + } catch (SipException | InvalidArgumentException | ParseException e) { + logger.error("[鍛戒护鍙戦�佸け璐 鍥芥爣绾ц仈 鍥炲SdpAck", e); } }; SipSubscribe.Event errorEvent = ((event) -> { @@ -420,7 +416,7 @@ Response response = getMessageFactory().createResponse(event.statusCode, evt.getRequest()); sipSender.transmitRequest(request.getLocalAddress().getHostAddress(), response); } catch (ParseException | SipException e) { - e.printStackTrace(); + logger.error("鏈鐞嗙殑寮傚父 ", e); } }); sendRtpItem.setApp("rtp"); @@ -531,7 +527,7 @@ } catch (SdpParseException e) { logger.error("sdp瑙f瀽閿欒", e); } catch (SdpException e) { - e.printStackTrace(); + logger.error("鏈鐞嗙殑寮傚父 ", e); } } @@ -686,11 +682,11 @@ mediaListManager.removedChannelOnlineEventLister(gbStream.getApp(), gbStream.getStream()); responseAck(request, Response.REQUEST_TIMEOUT); // 瓒呮椂 } catch (SipException e) { - e.printStackTrace(); + logger.error("鏈鐞嗙殑寮傚父 ", e); } catch (InvalidArgumentException e) { - e.printStackTrace(); + logger.error("鏈鐞嗙殑寮傚父 ", e); } catch (ParseException e) { - e.printStackTrace(); + logger.error("鏈鐞嗙殑寮傚父 ", e); } }, userSetting.getPlatformPlayTimeout()); // 娣诲姞鐩戝惉 @@ -709,11 +705,11 @@ try { responseAck(request, Response.BUSY_HERE); } catch (SipException e) { - e.printStackTrace(); + logger.error("鏈鐞嗙殑寮傚父 ", e); } catch (InvalidArgumentException e) { - e.printStackTrace(); + logger.error("鏈鐞嗙殑寮傚父 ", e); } catch (ParseException e) { - e.printStackTrace(); + logger.error("鏈鐞嗙殑寮傚父 ", e); } return; } @@ -771,11 +767,11 @@ try { responseAck(request, Response.BUSY_HERE); } catch (SipException e) { - e.printStackTrace(); + logger.error("鏈鐞嗙殑寮傚父 ", e); } catch (InvalidArgumentException e) { - e.printStackTrace(); + logger.error("鏈鐞嗙殑寮傚父 ", e); } catch (ParseException e) { - e.printStackTrace(); + logger.error("鏈鐞嗙殑寮傚父 ", e); } return; } @@ -851,11 +847,11 @@ try { return responseSdpAck(request, content.toString(), platform); } catch (SipException e) { - e.printStackTrace(); + logger.error("鏈鐞嗙殑寮傚父 ", e); } catch (InvalidArgumentException e) { - e.printStackTrace(); + logger.error("鏈鐞嗙殑寮傚父 ", e); } catch (ParseException e) { - e.printStackTrace(); + logger.error("鏈鐞嗙殑寮傚父 ", e); } return null; } diff --git a/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/event/request/impl/NotifyRequestProcessor.java b/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/event/request/impl/NotifyRequestProcessor.java index b79b800..7366f30 100644 --- a/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/event/request/impl/NotifyRequestProcessor.java +++ b/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/event/request/impl/NotifyRequestProcessor.java @@ -93,7 +93,7 @@ try { responseAck((SIPRequest) evt.getRequest(), Response.OK, null, null); }catch (SipException | InvalidArgumentException | ParseException e) { - e.printStackTrace(); + logger.error("鏈鐞嗙殑寮傚父 ", e); } boolean runed = !taskQueue.isEmpty(); taskQueue.offer(new HandlerCatchData(evt, null, null)); @@ -225,7 +225,7 @@ jsonObject.put("speed", mobilePosition.getSpeed()); redisCatchStorage.sendMobilePositionMsg(jsonObject); } catch (DocumentException e) { - e.printStackTrace(); + logger.error("鏈鐞嗙殑寮傚父 ", e); } } @@ -335,7 +335,7 @@ publisher.deviceAlarmEventPublish(deviceAlarm); } } catch (DocumentException e) { - e.printStackTrace(); + logger.error("鏈鐞嗙殑寮傚父 ", e); } } @@ -428,7 +428,7 @@ } } } catch (DocumentException e) { - e.printStackTrace(); + logger.error("鏈鐞嗙殑寮傚父 ", e); } } diff --git a/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/event/request/impl/RegisterRequestProcessor.java b/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/event/request/impl/RegisterRequestProcessor.java index 80744c0..d307941 100644 --- a/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/event/request/impl/RegisterRequestProcessor.java +++ b/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/event/request/impl/RegisterRequestProcessor.java @@ -185,7 +185,7 @@ deviceService.offline(deviceId, "涓诲姩娉ㄩ攢"); } } catch (SipException | NoSuchAlgorithmException | ParseException e) { - e.printStackTrace(); + logger.error("鏈鐞嗙殑寮傚父 ", e); } } } diff --git a/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/event/request/impl/SubscribeRequestProcessor.java b/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/event/request/impl/SubscribeRequestProcessor.java index d32d194..52a0f5d 100644 --- a/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/event/request/impl/SubscribeRequestProcessor.java +++ b/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/event/request/impl/SubscribeRequestProcessor.java @@ -96,7 +96,7 @@ sipSender.transmitRequest(request.getLocalAddress().getHostAddress(), response); } } catch (ParseException | SipException | InvalidArgumentException | DocumentException e) { - e.printStackTrace(); + logger.error("鏈鐞嗙殑寮傚父 ", e); } } @@ -149,7 +149,7 @@ } } catch (SipException | InvalidArgumentException | ParseException e) { - e.printStackTrace(); + logger.error("鏈鐞嗙殑寮傚父 ", e); } } @@ -195,7 +195,7 @@ subscribeHolder.putCatalogSubscribe(platformId, subscribeInfo); } } catch (SipException | InvalidArgumentException | ParseException e) { - e.printStackTrace(); + logger.error("鏈鐞嗙殑寮傚父 ", e); } } } diff --git a/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/event/request/impl/message/notify/cmd/AlarmNotifyMessageHandler.java b/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/event/request/impl/message/notify/cmd/AlarmNotifyMessageHandler.java index e89e88a..ddbad1d 100644 --- a/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/event/request/impl/message/notify/cmd/AlarmNotifyMessageHandler.java +++ b/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/event/request/impl/message/notify/cmd/AlarmNotifyMessageHandler.java @@ -186,9 +186,13 @@ // 鍙戦�佺粰骞冲彴鐨勬姤璀︿俊鎭�� 鍙戦�乺edis閫氱煡 logger.info("[鍙戦�佺粰骞冲彴鐨勬姤璀︿俊鎭痌鍐呭锛歿}", JSONObject.toJSONString(deviceAlarm)); AlarmChannelMessage alarmChannelMessage = new AlarmChannelMessage(); - alarmChannelMessage.setAlarmSn(Integer.parseInt(deviceAlarm.getAlarmMethod())); + if (deviceAlarm.getAlarmMethod() != null) { + alarmChannelMessage.setAlarmSn(Integer.parseInt(deviceAlarm.getAlarmMethod())); + } alarmChannelMessage.setAlarmDescription(deviceAlarm.getAlarmDescription()); - alarmChannelMessage.setAlarmType(Integer.parseInt(deviceAlarm.getAlarmType())); + if (deviceAlarm.getAlarmType() != null) { + alarmChannelMessage.setAlarmType(Integer.parseInt(deviceAlarm.getAlarmType())); + } alarmChannelMessage.setGbId(channelId); redisCatchStorage.sendAlarmMsg(alarmChannelMessage); continue; @@ -204,6 +208,7 @@ publisher.deviceAlarmEventPublish(deviceAlarm); } }catch (Exception e) { + logger.error("鏈鐞嗙殑寮傚父 ", e); logger.warn("[鏀跺埌鎶ヨ閫氱煡] 鍙戠幇鏈鐞嗙殑寮傚父, {}\r\n{}",e.getMessage(), evt.getRequest()); } } diff --git a/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/event/request/impl/message/notify/cmd/MobilePositionNotifyMessageHandler.java b/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/event/request/impl/message/notify/cmd/MobilePositionNotifyMessageHandler.java index 40d1dcc..1f0bdf1 100644 --- a/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/event/request/impl/message/notify/cmd/MobilePositionNotifyMessageHandler.java +++ b/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/event/request/impl/message/notify/cmd/MobilePositionNotifyMessageHandler.java @@ -149,9 +149,10 @@ redisCatchStorage.sendMobilePositionMsg(jsonObject); } catch (DocumentException e) { - e.printStackTrace(); + logger.error("鏈鐞嗙殑寮傚父 ", e); } catch (Exception e) { - logger.warn("[绉诲姩浣嶇疆閫氱煡] 鍙戠幇鏈鐞嗙殑寮傚父, {}\r\n{}",e.getMessage(), evt.getRequest()); + logger.warn("[绉诲姩浣嶇疆閫氱煡] 鍙戠幇鏈鐞嗙殑寮傚父, \r\n{}", evt.getRequest()); + logger.error("[绉诲姩浣嶇疆閫氱煡] 寮傚父鍐呭锛� ", e); } } }); diff --git a/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/event/request/impl/message/query/cmd/DeviceInfoQueryMessageHandler.java b/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/event/request/impl/message/query/cmd/DeviceInfoQueryMessageHandler.java index 0faf294..8b774e1 100644 --- a/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/event/request/impl/message/query/cmd/DeviceInfoQueryMessageHandler.java +++ b/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/event/request/impl/message/query/cmd/DeviceInfoQueryMessageHandler.java @@ -60,17 +60,24 @@ return; } String sn = rootElement.element("SN").getText(); + /*鏍规嵁WVP鍘熸湁鐨勬暟鎹粨鏋勶紝璁惧鍜岄�氶亾鏄垎寮�鏀剧疆锛岃澶囦俊鎭兘鏄瓨鏀惧湪璁惧琛ㄩ噷锛岄�氶亾琛ㄩ噷鐨勮澶囦俊鎭笉鍙綔涓虹湡瀹炰俊鎭鐞� 澶ч儴鍒哊VR/IPC璁惧瀵逛粬鐨勯�氶亾淇℃伅瀹炵幇閮芥槸杩斿洖榛樿鐨勫�兼病鏈変粈涔堝弬鑰冧环鍊笺�侼VR/IPC閫氶亾鎴戜滑缁熶竴浣跨敤璁惧琛ㄧ殑璁惧淇℃伅鏉ヤ綔涓鸿繑鍥炪�� 鎴戜滑杩欓噷浣跨敤鏌ヨ鏁版嵁搴撶殑鏂瑰紡鏉ュ疄鐜拌繖涓澶囦俊鎭煡璇㈢殑鍔熻兘锛屽湪鍏朵粬鍦版柟瀵硅澶囦俊鎭洿鏂拌揪鍒版纭殑鐩殑銆�*/ + String channelId = getText(rootElement, "DeviceID"); - Device device = storager.queryDeviceInfoByPlatformIdAndChannelId(parentPlatform.getServerGBId(), channelId); - if (device ==null){ - logger.error("[骞冲彴娌℃湁璇ラ�氶亾鐨勪娇鐢ㄦ潈闄怾:platformId"+parentPlatform.getServerGBId()+" deviceID:"+channelId); - return; + // 鏌ヨ杩欐槸閫氶亾id杩樻槸璁惧id + Device device = null; + // 濡傛灉id鎸囧悜骞冲彴鐨勫浗鏍囩紪鍙凤紝閭d箞灏辨槸鏌ヨ骞冲彴鐨勪俊鎭� + if (!parentPlatform.getDeviceGBId().equals(channelId)) { + device = storager.queryDeviceInfoByPlatformIdAndChannelId(parentPlatform.getServerGBId(), channelId); + if (device ==null){ + logger.error("[骞冲彴娌℃湁璇ラ�氶亾鐨勪娇鐢ㄦ潈闄怾:platformId"+parentPlatform.getServerGBId()+" deviceID:"+channelId); + return; + } } try { - cmderFroPlatform.deviceInfoResponse(parentPlatform,device, sn, fromHeader.getTag()); + cmderFroPlatform.deviceInfoResponse(parentPlatform, device, sn, fromHeader.getTag()); } catch (SipException | InvalidArgumentException | ParseException e) { logger.error("[鍛戒护鍙戦�佸け璐 鍥芥爣绾ц仈 DeviceInfo鏌ヨ鍥炲: {}", e.getMessage()); } diff --git a/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/event/request/impl/message/response/cmd/CatalogResponseMessageHandler.java b/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/event/request/impl/message/response/cmd/CatalogResponseMessageHandler.java index a907999..eb8555a 100644 --- a/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/event/request/impl/message/response/cmd/CatalogResponseMessageHandler.java +++ b/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/event/request/impl/message/response/cmd/CatalogResponseMessageHandler.java @@ -131,7 +131,8 @@ } }catch (Exception e) { - logger.warn("[鏀跺埌閫氶亾] 鍙戠幇鏈鐞嗙殑寮傚父, {}\r\n{}",e.getMessage(), evt.getRequest()); + logger.warn("[鏀跺埌閫氶亾] 鍙戠幇鏈鐞嗙殑寮傚父, \r\n{}", evt.getRequest()); + logger.error("[鏀跺埌閫氶亾] 寮傚父鍐呭锛� ", e); } } }); diff --git a/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/event/request/impl/message/response/cmd/MobilePositionResponseMessageHandler.java b/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/event/request/impl/message/response/cmd/MobilePositionResponseMessageHandler.java index 226799a..332f363 100644 --- a/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/event/request/impl/message/response/cmd/MobilePositionResponseMessageHandler.java +++ b/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/event/request/impl/message/response/cmd/MobilePositionResponseMessageHandler.java @@ -142,7 +142,7 @@ } } catch (DocumentException e) { - e.printStackTrace(); + logger.error("鏈鐞嗙殑寮傚父 ", e); } } diff --git a/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/event/request/impl/message/response/cmd/RecordInfoResponseMessageHandler.java b/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/event/request/impl/message/response/cmd/RecordInfoResponseMessageHandler.java index 93c9d2f..a667c67 100644 --- a/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/event/request/impl/message/response/cmd/RecordInfoResponseMessageHandler.java +++ b/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/event/request/impl/message/response/cmd/RecordInfoResponseMessageHandler.java @@ -150,7 +150,8 @@ } } } catch (Exception e) { - logger.error("[鍥芥爣褰曞儚] 鍙戠幇鏈鐞嗙殑寮傚父, "+e.getMessage(), e); + logger.error("[鍥芥爣褰曞儚] 鍙戠幇鏈鐞嗙殑寮傚父, \r\n{}", evt.getRequest()); + logger.error("[鍥芥爣褰曞儚] 寮傚父鍐呭锛� ", e); } }); } diff --git a/src/main/java/com/genersoft/iot/vmp/media/zlm/ZLMRTPServerFactory.java b/src/main/java/com/genersoft/iot/vmp/media/zlm/ZLMRTPServerFactory.java index c627215..9bf1a3a 100644 --- a/src/main/java/com/genersoft/iot/vmp/media/zlm/ZLMRTPServerFactory.java +++ b/src/main/java/com/genersoft/iot/vmp/media/zlm/ZLMRTPServerFactory.java @@ -221,7 +221,7 @@ if (localPort == 0) { return null; } - }alarm + } SendRtpItem sendRtpItem = new SendRtpItem(); sendRtpItem.setIp(ip); sendRtpItem.setPort(port); diff --git a/src/main/java/com/genersoft/iot/vmp/service/impl/StreamProxyServiceImpl.java b/src/main/java/com/genersoft/iot/vmp/service/impl/StreamProxyServiceImpl.java index ea0fd50..02f4f91 100644 --- a/src/main/java/com/genersoft/iot/vmp/service/impl/StreamProxyServiceImpl.java +++ b/src/main/java/com/genersoft/iot/vmp/service/impl/StreamProxyServiceImpl.java @@ -207,7 +207,7 @@ dataSourceTransactionManager.commit(transactionStatus); //鎵嬪姩鎻愪氦 result = true; }catch (Exception e) { - e.printStackTrace(); + logger.error("鏈鐞嗙殑寮傚父 ", e); dataSourceTransactionManager.rollback(transactionStatus); } return result; diff --git a/src/main/java/com/genersoft/iot/vmp/service/redisMsg/RedisAlarmMsgListener.java b/src/main/java/com/genersoft/iot/vmp/service/redisMsg/RedisAlarmMsgListener.java index 6eacd39..194e90f 100644 --- a/src/main/java/com/genersoft/iot/vmp/service/redisMsg/RedisAlarmMsgListener.java +++ b/src/main/java/com/genersoft/iot/vmp/service/redisMsg/RedisAlarmMsgListener.java @@ -55,7 +55,7 @@ boolean isEmpty = taskQueue.isEmpty(); taskQueue.offer(message); if (isEmpty) { - logger.info("[绾跨▼姹犱俊鎭痌娲诲姩绾跨▼鏁帮細{}, 鏈�澶х嚎绋嬫暟锛� {}", taskExecutor.getActiveCount(), taskExecutor.getMaxPoolSize()); +// logger.info("[绾跨▼姹犱俊鎭痌娲诲姩绾跨▼鏁帮細{}, 鏈�澶х嚎绋嬫暟锛� {}", taskExecutor.getActiveCount(), taskExecutor.getMaxPoolSize()); taskExecutor.execute(() -> { while (!taskQueue.isEmpty()) { Message msg = taskQueue.poll(); @@ -140,6 +140,7 @@ } } }catch (Exception e) { + logger.error("鏈鐞嗙殑寮傚父 ", e); logger.warn("[REDIS鐨凙LARM閫氱煡] 鍙戠幇鏈鐞嗙殑寮傚父, {}",e.getMessage()); } } diff --git a/src/main/java/com/genersoft/iot/vmp/service/redisMsg/RedisGbPlayMsgListener.java b/src/main/java/com/genersoft/iot/vmp/service/redisMsg/RedisGbPlayMsgListener.java index 35ed99e..c372647 100644 --- a/src/main/java/com/genersoft/iot/vmp/service/redisMsg/RedisGbPlayMsgListener.java +++ b/src/main/java/com/genersoft/iot/vmp/service/redisMsg/RedisGbPlayMsgListener.java @@ -202,7 +202,8 @@ } }catch (Exception e) { - logger.warn("[RedisGbPlayMsg] 鍙戠幇鏈鐞嗙殑寮傚父, {}",e.getMessage()); + logger.warn("[RedisGbPlayMsg] 鍙戠幇鏈鐞嗙殑寮傚父, \r\n{}", JSON.toJSONString(message)); + logger.error("[RedisGbPlayMsg] 寮傚父鍐呭锛� ", e); } } }); diff --git a/src/main/java/com/genersoft/iot/vmp/service/redisMsg/RedisGpsMsgListener.java b/src/main/java/com/genersoft/iot/vmp/service/redisMsg/RedisGpsMsgListener.java index 0c99707..4e81a59 100644 --- a/src/main/java/com/genersoft/iot/vmp/service/redisMsg/RedisGpsMsgListener.java +++ b/src/main/java/com/genersoft/iot/vmp/service/redisMsg/RedisGpsMsgListener.java @@ -53,7 +53,8 @@ // 鍙槸鏀惧叆redis缂撳瓨璧锋潵 redisCatchStorage.updateGpsMsgInfo(gpsMsgInfo); }catch (Exception e) { - logger.warn("[REDIS鐨凙LARM閫氱煡] 鍙戠幇鏈鐞嗙殑寮傚父, {}",e.getMessage()); + logger.warn("[REDIS鐨凙LARM閫氱煡] 鍙戠幇鏈鐞嗙殑寮傚父, \r\n{}", JSON.toJSONString(message)); + logger.error("[REDIS鐨凙LARM閫氱煡] 寮傚父鍐呭锛� ", e); } } }); diff --git a/src/main/java/com/genersoft/iot/vmp/service/redisMsg/RedisPushStreamResponseListener.java b/src/main/java/com/genersoft/iot/vmp/service/redisMsg/RedisPushStreamResponseListener.java index 33eae1e..c90771b 100644 --- a/src/main/java/com/genersoft/iot/vmp/service/redisMsg/RedisPushStreamResponseListener.java +++ b/src/main/java/com/genersoft/iot/vmp/service/redisMsg/RedisPushStreamResponseListener.java @@ -58,7 +58,8 @@ responseEvents.get(response.getApp() + response.getStream()).run(response); } }catch (Exception e) { - logger.warn("[REDIS鐨凙LARM閫氱煡] 鍙戠幇鏈鐞嗙殑寮傚父, {}",e.getMessage()); + logger.warn("[REDIS娑堟伅-璇锋眰鎺ㄦ祦缁撴灉] 鍙戠幇鏈鐞嗙殑寮傚父, \r\n{}", JSON.toJSONString(message)); + logger.error("[REDIS娑堟伅-璇锋眰鎺ㄦ祦缁撴灉] 寮傚父鍐呭锛� ", e); } } }); diff --git a/src/main/java/com/genersoft/iot/vmp/service/redisMsg/RedisPushStreamStatusListMsgListener.java b/src/main/java/com/genersoft/iot/vmp/service/redisMsg/RedisPushStreamStatusListMsgListener.java index d8ed1a0..cb34ff5 100644 --- a/src/main/java/com/genersoft/iot/vmp/service/redisMsg/RedisPushStreamStatusListMsgListener.java +++ b/src/main/java/com/genersoft/iot/vmp/service/redisMsg/RedisPushStreamStatusListMsgListener.java @@ -95,7 +95,8 @@ gbStreamService.updateGbIdOrName(streamPushItemForUpdate); } }catch (Exception e) { - logger.warn("[REDIS鐨凙LARM閫氱煡] 鍙戠幇鏈鐞嗙殑寮傚父, {}",e.getMessage()); + logger.warn("[REDIS娑堟伅-鎺ㄦ祦璁惧鍒楄〃鏇存柊] 鍙戠幇鏈鐞嗙殑寮傚父, \r\n{}", JSON.toJSONString(message)); + logger.error("[REDIS娑堟伅-鎺ㄦ祦璁惧鍒楄〃鏇存柊] 寮傚父鍐呭锛� ", e); } } }); diff --git a/src/main/java/com/genersoft/iot/vmp/service/redisMsg/RedisPushStreamStatusMsgListener.java b/src/main/java/com/genersoft/iot/vmp/service/redisMsg/RedisPushStreamStatusMsgListener.java index 96ff8e8..d7e02f5 100644 --- a/src/main/java/com/genersoft/iot/vmp/service/redisMsg/RedisPushStreamStatusMsgListener.java +++ b/src/main/java/com/genersoft/iot/vmp/service/redisMsg/RedisPushStreamStatusMsgListener.java @@ -79,7 +79,8 @@ streamPushService.online(statusChangeFromPushStream.getOnlineStreams()); } }catch (Exception e) { - logger.warn("[REDIS鐨凙LARM閫氱煡] 鍙戠幇鏈鐞嗙殑寮傚父, {}",e.getMessage()); + logger.warn("[REDIS娑堟伅-鎺ㄦ祦璁惧鐘舵�佸彉鍖朷 鍙戠幇鏈鐞嗙殑寮傚父, \r\n{}", JSON.toJSONString(message)); + logger.error("[REDIS娑堟伅-鎺ㄦ祦璁惧鐘舵�佸彉鍖朷 寮傚父鍐呭锛� ", e); } } }); diff --git a/src/main/java/com/genersoft/iot/vmp/service/redisMsg/RedisStreamMsgListener.java b/src/main/java/com/genersoft/iot/vmp/service/redisMsg/RedisStreamMsgListener.java index 1cdc527..f5f2948 100644 --- a/src/main/java/com/genersoft/iot/vmp/service/redisMsg/RedisStreamMsgListener.java +++ b/src/main/java/com/genersoft/iot/vmp/service/redisMsg/RedisStreamMsgListener.java @@ -82,7 +82,8 @@ zlmMediaListManager.removeMedia(app, stream); } }catch (Exception e) { - logger.warn("[REDIS鐨凙LARM閫氱煡] 鍙戠幇鏈鐞嗙殑寮傚父, {}",e.getMessage()); + logger.warn("[REDIS娑堟伅-娴佸彉鍖朷 鍙戠幇鏈鐞嗙殑寮傚父, \r\n{}", JSON.toJSONString(message)); + logger.error("[REDIS娑堟伅-娴佸彉鍖朷 寮傚父鍐呭锛� ", e); } } }); diff --git a/src/main/java/com/genersoft/iot/vmp/storager/impl/VideoManagerStorageImpl.java b/src/main/java/com/genersoft/iot/vmp/storager/impl/VideoManagerStorageImpl.java index 3920fc7..1ce01df 100644 --- a/src/main/java/com/genersoft/iot/vmp/storager/impl/VideoManagerStorageImpl.java +++ b/src/main/java/com/genersoft/iot/vmp/storager/impl/VideoManagerStorageImpl.java @@ -197,7 +197,7 @@ dataSourceTransactionManager.commit(transactionStatus); //鎵嬪姩鎻愪氦 return true; }catch (Exception e) { - e.printStackTrace(); + logger.error("鏈鐞嗙殑寮傚父 ", e); dataSourceTransactionManager.rollback(transactionStatus); return false; } @@ -313,7 +313,7 @@ } return true; }catch (Exception e) { - e.printStackTrace(); + logger.error("鏈鐞嗙殑寮傚父 ", e); dataSourceTransactionManager.rollback(transactionStatus); return false; } diff --git a/src/main/java/com/genersoft/iot/vmp/utils/redis/RedisUtil.java b/src/main/java/com/genersoft/iot/vmp/utils/redis/RedisUtil.java index e54ed53..d8270f1 100644 --- a/src/main/java/com/genersoft/iot/vmp/utils/redis/RedisUtil.java +++ b/src/main/java/com/genersoft/iot/vmp/utils/redis/RedisUtil.java @@ -38,7 +38,7 @@ } return true; } catch (Exception e) { - e.printStackTrace(); + logger.error("鏈鐞嗙殑寮傚父 ", e); return false; } } @@ -66,7 +66,7 @@ try { return redisTemplate.hasKey(key); } catch (Exception e) { - e.printStackTrace(); + logger.error("鏈鐞嗙殑寮傚父 ", e); return false; } } @@ -91,7 +91,7 @@ } return true; } catch (Exception e) { - e.printStackTrace(); + logger.error("鏈鐞嗙殑寮傚父 ", e); return false; } } @@ -124,7 +124,7 @@ redisTemplate.opsForValue().set(key, value); return true; } catch (Exception e) { - e.printStackTrace(); + logger.error("鏈鐞嗙殑寮傚父 ", e); return false; } } @@ -148,7 +148,7 @@ } return true; } catch (Exception e) { - e.printStackTrace(); + logger.error("鏈鐞嗙殑寮傚父 ", e); return false; } } @@ -226,7 +226,7 @@ redisTemplate.opsForHash().putAll(key, map); return true; } catch (Exception e) { - e.printStackTrace(); + logger.error("鏈鐞嗙殑寮傚父 ", e); return false; } } @@ -249,7 +249,7 @@ } return true; } catch (Exception e) { - e.printStackTrace(); + logger.error("鏈鐞嗙殑寮傚父 ", e); return false; } } @@ -269,7 +269,7 @@ redisTemplate.opsForHash().put(key, item, value); return true; } catch (Exception e) { - e.printStackTrace(); + logger.error("鏈鐞嗙殑寮傚父 ", e); return false; } } @@ -293,7 +293,7 @@ } return true; } catch (Exception e) { - e.printStackTrace(); + logger.error("鏈鐞嗙殑寮傚父 ", e); return false; } } @@ -365,7 +365,7 @@ try { return redisTemplate.opsForSet().members(key); } catch (Exception e) { - e.printStackTrace(); + logger.error("鏈鐞嗙殑寮傚父 ", e); return null; } } @@ -383,7 +383,7 @@ try { return redisTemplate.opsForSet().isMember(key, value); } catch (Exception e) { - e.printStackTrace(); + logger.error("鏈鐞嗙殑寮傚父 ", e); return false; } } @@ -401,7 +401,7 @@ try { return redisTemplate.opsForSet().add(key, values); } catch (Exception e) { - e.printStackTrace(); + logger.error("鏈鐞嗙殑寮傚父 ", e); return 0; } } @@ -424,7 +424,7 @@ } return count; } catch (Exception e) { - e.printStackTrace(); + logger.error("鏈鐞嗙殑寮傚父 ", e); return 0; } } @@ -441,7 +441,7 @@ try { return redisTemplate.opsForSet().size(key); } catch (Exception e) { - e.printStackTrace(); + logger.error("鏈鐞嗙殑寮傚父 ", e); return 0; } } @@ -459,7 +459,7 @@ try { return redisTemplate.opsForSet().remove(key, values); } catch (Exception e) { - e.printStackTrace(); + logger.error("鏈鐞嗙殑寮傚父 ", e); return 0; } } @@ -625,7 +625,7 @@ try { return redisTemplate.opsForList().range(key, start, end); } catch (Exception e) { - e.printStackTrace(); + logger.error("鏈鐞嗙殑寮傚父 ", e); return null; } } @@ -642,7 +642,7 @@ try { return redisTemplate.opsForList().size(key); } catch (Exception e) { - e.printStackTrace(); + logger.error("鏈鐞嗙殑寮傚父 ", e); return 0; } } @@ -662,7 +662,7 @@ try { return redisTemplate.opsForList().index(key, index); } catch (Exception e) { - e.printStackTrace(); + logger.error("鏈鐞嗙殑寮傚父 ", e); return null; } } @@ -681,7 +681,7 @@ redisTemplate.opsForList().rightPush(key, value); return true; } catch (Exception e) { - e.printStackTrace(); + logger.error("鏈鐞嗙殑寮傚父 ", e); return false; } } @@ -704,7 +704,7 @@ } return true; } catch (Exception e) { - e.printStackTrace(); + logger.error("鏈鐞嗙殑寮傚父 ", e); return false; } } @@ -723,7 +723,7 @@ redisTemplate.opsForList().rightPushAll(key, values); return true; } catch (Exception e) { - e.printStackTrace(); + logger.error("鏈鐞嗙殑寮傚父 ", e); return false; } } @@ -746,7 +746,7 @@ } return true; } catch (Exception e) { - e.printStackTrace(); + logger.error("鏈鐞嗙殑寮傚父 ", e); return false; } } @@ -766,7 +766,7 @@ redisTemplate.opsForList().set(key, index, value); return true; } catch (Exception e) { - e.printStackTrace(); + logger.error("鏈鐞嗙殑寮傚父 ", e); return false; } } @@ -787,7 +787,7 @@ try { return redisTemplate.opsForList().remove(key, count, value); } catch (Exception e) { - e.printStackTrace(); + logger.error("鏈鐞嗙殑寮傚父 ", e); return 0; } } @@ -829,7 +829,7 @@ Set<String> set = redisTemplate.keys(key); return new ArrayList<>(set); } catch (Exception e) { - e.printStackTrace(); + logger.error("鏈鐞嗙殑寮傚父 ", e); return null; } } @@ -854,7 +854,7 @@ // //鍏抽棴cursor // cursor.close(); // } catch (Exception e) { -// e.printStackTrace(); +// logger.error("鏈鐞嗙殑寮傚父 ", e); // } // return result; // } diff --git a/src/main/java/com/genersoft/iot/vmp/vmanager/streamPush/StreamPushController.java b/src/main/java/com/genersoft/iot/vmp/vmanager/streamPush/StreamPushController.java index 6622568..5c8bf36 100644 --- a/src/main/java/com/genersoft/iot/vmp/vmanager/streamPush/StreamPushController.java +++ b/src/main/java/com/genersoft/iot/vmp/vmanager/streamPush/StreamPushController.java @@ -181,7 +181,7 @@ String name = file.getName(); inputStream = file.getInputStream(); } catch (IOException e) { - e.printStackTrace(); + logger.error("鏈鐞嗙殑寮傚父 ", e); } try { //浼犲叆鍙傛暟 diff --git a/web_src/src/components/dialog/platformEdit.vue b/web_src/src/components/dialog/platformEdit.vue index 2844fcc..0298ee7 100644 --- a/web_src/src/components/dialog/platformEdit.vue +++ b/web_src/src/components/dialog/platformEdit.vue @@ -215,7 +215,7 @@ this.platform.enable = platform.enable; this.platform.ptz = platform.ptz; this.platform.rtcp = platform.rtcp; - this.platform.rtcpasMessageChannel = platform.asMessageChannel; + this.platform.asMessageChannel = platform.asMessageChannel; this.platform.name = platform.name; this.platform.serverGBId = platform.serverGBId; this.platform.serverGBDomain = platform.serverGBDomain; -- Gitblit v1.8.0