新增业务流量上报
This commit is contained in:
@@ -43,6 +43,8 @@ public enum MsgEnum {
|
||||
|
||||
网络上报重试("NET_RECOVER"),
|
||||
|
||||
业务网络上报("BUSINESS_NET"),
|
||||
|
||||
挂载上报("POINT"),
|
||||
|
||||
系统其他上报("OTHER_SYSTEM"),
|
||||
|
||||
@@ -231,6 +231,22 @@ public class AgentEndpoint {
|
||||
}
|
||||
}
|
||||
|
||||
@AgentDispatcher(msgId = MsgEnum.业务网络上报)
|
||||
public class BusinessNetHandler 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 {
|
||||
@Override
|
||||
|
||||
Reference in New Issue
Block a user