|
@@ -84,7 +84,7 @@ public class MqttMsgRedisService {
|
|
|
public void addRedis(CareMqttMsg careMqttMsg, long execTime){
|
|
|
|
|
|
String msg = String.valueOf(careMqttMsg.getId());
|
|
|
- redisUtil.zSetAdd(Constants.MQTT_DELAY_MSG_KEY, msg, execTime);
|
|
|
+ redisUtil.zSetAdd(Constants.MQTT_MSG_LAG_KEY, msg, execTime);
|
|
|
}
|
|
|
|
|
|
/**
|
|
@@ -95,17 +95,17 @@ public class MqttMsgRedisService {
|
|
|
long endTime = System.currentTimeMillis();
|
|
|
|
|
|
//查询符合时间条件下的集合
|
|
|
- Set set = redisUtil.zSetRangeByScore(Constants.MQTT_DELAY_MSG_KEY, startTime, endTime);
|
|
|
+ Set set = redisUtil.zSetRangeByScore(Constants.MQTT_MSG_LAG_KEY, startTime, endTime);
|
|
|
|
|
|
if (CollUtil.isNotEmpty(set)) {
|
|
|
//具体业务操作
|
|
|
set.forEach(item -> {
|
|
|
- CareMqttMsg careMqttMsg = careMqttMsgService.getById((Long)item);
|
|
|
+ CareMqttMsg careMqttMsg = careMqttMsgService.getById(Long.parseLong(String.valueOf(item)));
|
|
|
exe(careMqttMsg);
|
|
|
});
|
|
|
|
|
|
//移除集合
|
|
|
- redisUtil.zSetRemoveRangeByScore(Constants.MQTT_DELAY_MSG_KEY, startTime, endTime);
|
|
|
+ redisUtil.zSetRemoveRangeByScore(Constants.MQTT_MSG_LAG_KEY, startTime, endTime);
|
|
|
}
|
|
|
}
|
|
|
|