增加网络上报重试,和tcpdump结果上报

This commit is contained in:
gaoyutao
2026-01-22 17:58:31 +08:00
parent f9b9f06390
commit d579f85eee
2 changed files with 34 additions and 0 deletions
@@ -41,6 +41,8 @@ public enum MsgEnum {
网络上报("NET"),
网络上报重试("NET_RECOVER"),
挂载上报("POINT"),
系统其他上报("OTHER_SYSTEM"),
@@ -83,6 +85,8 @@ public enum MsgEnum {
iops结果上报("IOPS_RESULT"),
tcpdump结果上报("TCPDUMP_RESULT"),
多网IP探测上报("NETWORK_DETECT");
private String value;
@@ -214,6 +214,22 @@ public class AgentEndpoint {
.content(json.toString()).build();
}
}
@AgentDispatcher(msgId = MsgEnum.网络上报重试)
public class NetRecoverHandler implements AgentHandler {
@Override
public UpMsgResponse upHandle(String data, String clientId) {
JSONObject jsonObject = new JSONObject();
jsonObject.put("clientId", clientId);
jsonObject.put("dataType", MsgEnum.网络上报重试.getValue());
jsonObject.put("data", data);
MqMsg mqMsg = MqMsg.builder().topic(agentMqConfig.getAgentTopic()).content(jsonObject.toString()).build();
agentProducer.asyncSend(mqMsg);
JSONObject json = new JSONObject();
json.put("resCode",1);
return UpMsgResponse.builder().clientId(clientId).dataType(MsgEnum.采集上报应答.getValue())
.content(json.toString()).build();
}
}
@AgentDispatcher(msgId = MsgEnum.挂载上报)
public class PointHandler implements AgentHandler {
@@ -454,6 +470,20 @@ public class AgentEndpoint {
}
}
@AgentDispatcher(msgId = MsgEnum.tcpdump结果上报)
public class tcpdumpResultHandler implements AgentHandler {
@Override
public UpMsgResponse upHandle(String data, String clientId) {
JSONObject jsonObject = new JSONObject();
jsonObject.put("clientId", clientId);
jsonObject.put("dataType", MsgEnum.tcpdump结果上报.getValue());
jsonObject.put("data", data);
MqMsg mqMsg = MqMsg.builder().topic(agentMqConfig.getAgentTopic()).content(jsonObject.toString()).build();
agentProducer.asyncSend(mqMsg);
return null;
}
}