Commit 6f2bcf56 by YG8999

设备操作无响应重复轮询改为最多重复轮询3次

parent cc5f5385
...@@ -345,8 +345,12 @@ public class RedisTask { ...@@ -345,8 +345,12 @@ public class RedisTask {
if (redisUtil.getListSize(key2) > 0) { if (redisUtil.getListSize(key2) > 0) {
// 删除失败消息redis记录 // 删除失败消息redis记录
Object deleteData = redisUtil.getRightPop(key2, 10L); Object deleteData = redisUtil.getRightPop(key2, 10L);
// 将失败的消息放到redis最后重新发送 MqttxVo dvo = BeanUtil.toBean(deleteData, MqttxVo.class);
redisUtil.lPush(key2, deleteData); if (dvo != null && dvo.getRefreshNum() < 3) {
dvo.setRefreshNum(dvo.getRefreshNum() + 1);
// 将失败的消息放到redis最后重新发送
redisUtil.lPush(key2, dvo);
}
// 获取当前需要发送的消息 // 获取当前需要发送的消息
Object data = redisUtil.getIndex(key2, -1); Object data = redisUtil.getIndex(key2, -1);
if (null != data) { if (null != data) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment