1、修改等待中间件返回结果超时时间为10秒;
2、修改向水肥机下发命令相关逻辑;
3、修改水肥机回复命令结果处理逻辑;
4、去除前端webSocket关闭产生异常日志记录。
| | |
| | | ugCallbackUrl_rm: "http://127.0.0.1:8081/remote/rtuUpgradeStateReceiver/receive" |
| | | #微信小程序应用中Rtu远程命令结果回调地址 |
| | | rtuCallbackUrl_wx: "http://127.0.0.1:8087/wx/comRes/receive" |
| | | waitMwRtnResultTimeout: 60 #等待中间件返回结果超时时间,单位秒钟 |
| | | waitMwRtnResultTimeout: 10 #等待中间件返回结果超时时间,单位秒钟 |
| | | |
| | | #不进行userToken过滤的URL,@ConfigurationProperties要求tokennofilter中所有字母都小写 |
| | | tokennofilter: |
| | |
| | | while(node != null && node.obj != null){ |
| | | obj = (MqttPubMsgNode)node.obj; |
| | | pubMsg = obj.result ; |
| | | if(pubMsg != null |
| | | if(!obj.onceReceivedResult |
| | | && pubMsg != null |
| | | && subMsg.subMsgMatchPubMsg(pubMsg)){ |
| | | obj.onceReceivedResult = true ;//标识已经收到命令结果 |
| | | return pubMsg; |
| | |
| | | while(node != null && node.obj != null){ |
| | | obj = (MqttPubMsgNode)node.obj; |
| | | pubMsg = obj.result ; |
| | | if(pubMsg != null && subMsg.subMsgMatchPubMsg(pubMsg)){ |
| | | if(!obj.onceReceivedResult |
| | | && pubMsg != null |
| | | && subMsg.subMsgMatchPubMsg(pubMsg)){ |
| | | obj.onceReceivedResult = true ;//标识已经收到命令结果 |
| | | return pubMsg; |
| | | }else{ |
| | |
| | | } |
| | | } |
| | | lastUpManureData.put(msg.deviceId + nowVo.no, nowVo); |
| | | |
| | | if(msg.commandId != null && !msg.commandId.equals("")){ |
| | | this.toNextOneTask(data, TkFindComResponseSdV1.taskId); |
| | | } |
| | | } |
| | | } |
| | | private void deal(Object data, MqttSubMsg msg, ManureVo stVo, Long now, boolean dealOnlyLast){ |
| | |
| | | import com.dy.common.mw.protocol.Data; |
| | | import com.dy.common.mw.protocol4Mqtt.MqttSubMsg; |
| | | import com.dy.rtuMw.server.ServerProperties; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.apache.logging.log4j.LogManager; |
| | | import org.apache.logging.log4j.Logger; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | |
| | | * @LastEditTime 2023/12/21 20:28 |
| | | * @Description 通信中间件对外进行web调用,把命令结果发送出去 |
| | | */ |
| | | @Slf4j |
| | | @Component() |
| | | public class CommandResultDeal { |
| | | |
| | |
| | | */ |
| | | @OnError |
| | | public void onError(Session session, Throwable error) { |
| | | log.error("客户端:" + this.token + ",websocket会话异常,原因:" + error.getMessage()); |
| | | //log.error("客户端:" + this.token + ",websocket会话异常,原因:" + error.getMessage()); |
| | | } |
| | | |
| | | /** |