Commit cb41a43d by 111-PC\111

[+]kafka消费数据修改

1 parent 9c17576f
...@@ -12,10 +12,5 @@ public class Constants { ...@@ -12,10 +12,5 @@ public class Constants {
public static final String MACHINE_STATUS_ORDER = "machine_status"; public static final String MACHINE_STATUS_ORDER = "machine_status";
// 机器离家指令 // 机器离家指令
public static final String MACHINE_LEAVE_ORDER = "leavehome_flag"; public static final String MACHINE_LEAVE_ORDER = "leavehome_flag";
}
// 机器点火指令
public static final String MACHINE_STATUS_IN_VALUE = "true";
// 机器火指令
public static final String MACHINE_STATUS_FAM_ORDER = "false";
}
\ No newline at end of file \ No newline at end of file
...@@ -4,12 +4,14 @@ import cn.com.glsx.smart.queue.base.MessageReceiver; ...@@ -4,12 +4,14 @@ import cn.com.glsx.smart.queue.base.MessageReceiver;
import cn.com.glsx.smart.service.SmartDeviceStatusService; import cn.com.glsx.smart.service.SmartDeviceStatusService;
import cn.com.glsx.smart.utils.ProtobufConvert; import cn.com.glsx.smart.utils.ProtobufConvert;
import cn.com.glsx.smart.vo.Event; import cn.com.glsx.smart.vo.Event;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
/** /**
* @author zhouhaibao * @author zhouhaibao
* @date 2021/4/9 18:14 * @date 2021/4/9 18:14
*/ */
@Slf4j
public class LeaveHomeFlagConsumer extends MessageReceiver { public class LeaveHomeFlagConsumer extends MessageReceiver {
@Autowired @Autowired
...@@ -17,6 +19,7 @@ public class LeaveHomeFlagConsumer extends MessageReceiver { ...@@ -17,6 +19,7 @@ public class LeaveHomeFlagConsumer extends MessageReceiver {
@Override @Override
public void processMessage(String topic, byte[] message) { public void processMessage(String topic, byte[] message) {
log.info("topic{}开始消费",topic);
Event event = ProtobufConvert.convertLeaveHome(message); Event event = ProtobufConvert.convertLeaveHome(message);
if (event == null) { if (event == null) {
return; return;
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!