增加网络上报重试,和tcpdump结果上报
This commit is contained in:
@@ -41,6 +41,8 @@ public enum MsgEnum {
|
|||||||
|
|
||||||
网络上报("NET"),
|
网络上报("NET"),
|
||||||
|
|
||||||
|
网络上报重试("NET_RECOVER"),
|
||||||
|
|
||||||
挂载上报("POINT"),
|
挂载上报("POINT"),
|
||||||
|
|
||||||
系统其他上报("OTHER_SYSTEM"),
|
系统其他上报("OTHER_SYSTEM"),
|
||||||
@@ -83,6 +85,8 @@ public enum MsgEnum {
|
|||||||
|
|
||||||
iops结果上报("IOPS_RESULT"),
|
iops结果上报("IOPS_RESULT"),
|
||||||
|
|
||||||
|
tcpdump结果上报("TCPDUMP_RESULT"),
|
||||||
|
|
||||||
多网IP探测上报("NETWORK_DETECT");
|
多网IP探测上报("NETWORK_DETECT");
|
||||||
|
|
||||||
private String value;
|
private String value;
|
||||||
|
|||||||
@@ -214,6 +214,22 @@ public class AgentEndpoint {
|
|||||||
.content(json.toString()).build();
|
.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.挂载上报)
|
@AgentDispatcher(msgId = MsgEnum.挂载上报)
|
||||||
public class PointHandler implements AgentHandler {
|
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;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user