Commit 344692640c0f57a6ac43552f968c76cb082b7a36

Authored by 648540858
1 parent 2385f4b3

修复zlm离线时误报设备离线

src/main/java/com/genersoft/iot/vmp/gb28181/event/offline/KeepaliveTimeoutListenerForPlatform.java
@@ -57,7 +57,7 @@ public class KeepaliveTimeoutListenerForPlatform extends KeyExpirationEventMessa @@ -57,7 +57,7 @@ public class KeepaliveTimeoutListenerForPlatform extends KeyExpirationEventMessa
57 String platformGBId = expiredKey.substring(PLATFORM_REGISTER_PREFIX.length(),expiredKey.length()); 57 String platformGBId = expiredKey.substring(PLATFORM_REGISTER_PREFIX.length(),expiredKey.length());
58 58
59 publisher.platformNotRegisterEventPublish(platformGBId); 59 publisher.platformNotRegisterEventPublish(platformGBId);
60 - }else{ 60 + }else if (expiredKey.startsWith(KEEPLIVEKEY_PREFIX)){
61 String deviceId = expiredKey.substring(KEEPLIVEKEY_PREFIX.length(),expiredKey.length()); 61 String deviceId = expiredKey.substring(KEEPLIVEKEY_PREFIX.length(),expiredKey.length());
62 publisher.outlineEventPublish(deviceId, KEEPLIVEKEY_PREFIX); 62 publisher.outlineEventPublish(deviceId, KEEPLIVEKEY_PREFIX);
63 } 63 }
src/main/java/com/genersoft/iot/vmp/media/zlm/event/ZLMKeepliveTimeoutListener.java
@@ -58,12 +58,14 @@ public class ZLMKeepliveTimeoutListener extends KeyExpirationEventMessageListene @@ -58,12 +58,14 @@ public class ZLMKeepliveTimeoutListener extends KeyExpirationEventMessageListene
58 } 58 }
59 59
60 String mediaServerId = expiredKey.substring(KEEPLIVEKEY_PREFIX.length(),expiredKey.length()); 60 String mediaServerId = expiredKey.substring(KEEPLIVEKEY_PREFIX.length(),expiredKey.length());
  61 + logger.info("[zlm心跳到期]:" + mediaServerId);
61 // 发起http请求验证zlm是否确实无法连接,如果确实无法连接则发送离线事件,否则不作处理 62 // 发起http请求验证zlm是否确实无法连接,如果确实无法连接则发送离线事件,否则不作处理
62 MediaServerItem mediaServerItem = mediaServerService.getOne(mediaServerId); 63 MediaServerItem mediaServerItem = mediaServerService.getOne(mediaServerId);
63 JSONObject mediaServerConfig = zlmresTfulUtils.getMediaServerConfig(mediaServerItem); 64 JSONObject mediaServerConfig = zlmresTfulUtils.getMediaServerConfig(mediaServerItem);
64 if (mediaServerConfig == null) { 65 if (mediaServerConfig == null) {
65 publisher.zlmOfflineEventPublish(mediaServerId); 66 publisher.zlmOfflineEventPublish(mediaServerId);
66 }else { 67 }else {
  68 + logger.info("[zlm心跳到期]:{}验证后zlm仍在线,回复心跳信息", mediaServerId);
67 // 添加zlm信息 69 // 添加zlm信息
68 mediaServerService.updateMediaServerKeepalive(mediaServerId, mediaServerConfig); 70 mediaServerService.updateMediaServerKeepalive(mediaServerId, mediaServerConfig);
69 } 71 }