|
@@ -20,7 +20,7 @@ import org.eclipse.paho.client.mqttv3.MqttMessage;
|
|
|
import org.springframework.stereotype.Component;
|
|
import org.springframework.stereotype.Component;
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
|
- * 分发 dagent 发送的消息
|
|
|
|
|
|
|
+ * 处理 sub.dmaster topic 中的消息
|
|
|
*
|
|
*
|
|
|
* @author reghao
|
|
* @author reghao
|
|
|
* @date 2021-05-24 09:24:03
|
|
* @date 2021-05-24 09:24:03
|
|
@@ -33,10 +33,8 @@ public class MessageListener implements MqttCallback {
|
|
|
private final AppRpcClazzResult appRpcClazzResult;
|
|
private final AppRpcClazzResult appRpcClazzResult;
|
|
|
private final DockerRpcClazzResult dockerRpcClazzResult;
|
|
private final DockerRpcClazzResult dockerRpcClazzResult;
|
|
|
|
|
|
|
|
- public MessageListener(NodeClazzPubResult nodeClazzPubResult,
|
|
|
|
|
- MachineRpcClazzResult machineRpcClazzResult,
|
|
|
|
|
- AppRpcClazzResult appRpcClazzResult,
|
|
|
|
|
- DockerRpcClazzResult dockerRpcClazzResult) {
|
|
|
|
|
|
|
+ public MessageListener(NodeClazzPubResult nodeClazzPubResult, MachineRpcClazzResult machineRpcClazzResult,
|
|
|
|
|
+ AppRpcClazzResult appRpcClazzResult, DockerRpcClazzResult dockerRpcClazzResult) {
|
|
|
this.nodeClazzPubResult = nodeClazzPubResult;
|
|
this.nodeClazzPubResult = nodeClazzPubResult;
|
|
|
this.machineRpcClazzResult = machineRpcClazzResult;
|
|
this.machineRpcClazzResult = machineRpcClazzResult;
|
|
|
this.appRpcClazzResult = appRpcClazzResult;
|
|
this.appRpcClazzResult = appRpcClazzResult;
|
|
@@ -58,7 +56,7 @@ public class MessageListener implements MqttCallback {
|
|
|
processPubMsg(message1.getPubMsg());
|
|
processPubMsg(message1.getPubMsg());
|
|
|
break;
|
|
break;
|
|
|
case rpc:
|
|
case rpc:
|
|
|
- processRpcMsg(message1.getRpcMsg());
|
|
|
|
|
|
|
+ processRpcResult(message1.getRpcMsg());
|
|
|
break;
|
|
break;
|
|
|
default:
|
|
default:
|
|
|
}
|
|
}
|
|
@@ -80,7 +78,7 @@ public class MessageListener implements MqttCallback {
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- private void processRpcMsg(RpcMsg rpcMsg) {
|
|
|
|
|
|
|
+ private void processRpcResult(RpcMsg rpcMsg) {
|
|
|
String msgId = rpcMsg.getMsgId();
|
|
String msgId = rpcMsg.getMsgId();
|
|
|
RpcPayload rpcPayload = rpcMsg.getRpcPayload();
|
|
RpcPayload rpcPayload = rpcMsg.getRpcPayload();
|
|
|
String clazz = rpcPayload.getClazz();
|
|
String clazz = rpcPayload.getClazz();
|
|
@@ -103,7 +101,6 @@ public class MessageListener implements MqttCallback {
|
|
|
|
|
|
|
|
@Override
|
|
@Override
|
|
|
public void deliveryComplete(IMqttDeliveryToken token) {
|
|
public void deliveryComplete(IMqttDeliveryToken token) {
|
|
|
- log.info("token -> {}", token);
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
@Override
|