|
|
@@ -1,9 +1,7 @@
|
|
|
-package cn.reghao.autodop.common.mq;
|
|
|
+package cn.reghao.autodop.dmaster.cluster;
|
|
|
|
|
|
import cn.reghao.autodop.common.mq.protocol.MQMessage;
|
|
|
import cn.reghao.autodop.common.mq.protocol.machine.MachineMessage;
|
|
|
-import cn.reghao.autodop.common.mq.protocol.machine.MachineOps;
|
|
|
-import cn.reghao.autodop.common.mq.protocol.machine.MachineState;
|
|
|
import cn.reghao.autodop.common.mq.protocol.MessageType;
|
|
|
import cn.reghao.autodop.common.utils.data.serializer.JsonConverter;
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
@@ -18,10 +16,10 @@ import org.springframework.amqp.core.MessageListener;
|
|
|
*/
|
|
|
@Slf4j
|
|
|
public class RabbitConsumer implements MessageListener {
|
|
|
- private MessageDispatcher messageDispatcher;
|
|
|
+ private MessageDispatcher machineMessageDispatcher;
|
|
|
|
|
|
public RabbitConsumer() {
|
|
|
- this.messageDispatcher = new MachineMessageDispatcher();
|
|
|
+ this.machineMessageDispatcher = new MachineMessageDispatcher();
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
@@ -36,7 +34,7 @@ public class RabbitConsumer implements MessageListener {
|
|
|
(MachineMessage) JsonConverter.jsonToObject(mqMessage.getPayload(), MachineMessage.class);
|
|
|
String machineOps = machineMessage.getMachineOps();
|
|
|
String message = machineMessage.getMessage();
|
|
|
- messageDispatcher.dispatch(machineOps, message);
|
|
|
+ machineMessageDispatcher.dispatch(machineOps, message);
|
|
|
break;
|
|
|
case app:
|
|
|
log.info("msg from app...");
|
|
|
@@ -47,7 +45,4 @@ public class RabbitConsumer implements MessageListener {
|
|
|
log.error(e.getMessage());
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
- void receive(String queue) {
|
|
|
- }
|
|
|
}
|