agent版本更新应答优化
This commit is contained in:
@@ -339,12 +339,20 @@ public class AgentEndpoint {
|
||||
public class AgentVersionUpdateRspHandler implements AgentHandler {
|
||||
@Override
|
||||
public UpMsgResponse upHandle(String data, String clientId) {
|
||||
JSONObject jsonObject = JSONObject.parseObject(data);
|
||||
JSONObject jsonObject = new JSONObject();
|
||||
jsonObject.put("clientId", clientId);
|
||||
jsonObject.put("dataType", MsgEnum.Agent版本更新应答.getValue());
|
||||
jsonObject.put("data", data);
|
||||
MqMsg mqMsg = MqMsg.builder().topic(agentMqConfig.getAgentTopic()).content(jsonObject.toString()).build();
|
||||
agentProducer.asyncSend(mqMsg);
|
||||
JSONObject json = JSONObject.parseObject(data);
|
||||
int resCode = 0;
|
||||
if(json.containsKey("resCode")){
|
||||
resCode = json.getInteger("resCode");
|
||||
}
|
||||
if(resCode == 1){
|
||||
client.closeConnection(clientId);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user