增加redis通知方式向设备/平台发送报警消息功能

This commit is contained in:
648540858
2022-04-24 16:33:59 +08:00
parent 7f965a6922
commit 5dc08a45f8
16 changed files with 486 additions and 25 deletions

View File

@@ -139,6 +139,12 @@ public interface IRedisCatchStorage {
*/
void sendStreamChangeMsg(String type, JSONObject jsonObject);
/**
* 发送报警消息
* @param msg 消息内容
*/
void sendAlarmMsg(AlarmChannelMessage msg);
/**
* 添加流信息到redis
* @param mediaServerItem

View File

@@ -639,4 +639,10 @@ public class RedisCatchStorageImpl implements IRedisCatchStorage {
redis.convertAndSend(key, (JSONObject)JSON.toJSON(msg));
}
@Override
public void sendAlarmMsg(AlarmChannelMessage msg) {
String key = VideoManagerConstants.VM_MSG_SUBSCRIBE_ALARM;
logger.info("[redis 报警通知] {}: {}", key, JSON.toJSON(msg));
redis.convertAndSend(key, (JSONObject)JSON.toJSON(msg));
}
}