Commit 42f8974b by wnb0128

车家智能数据服务 用户经纬度日志--think.wang

1 parent 3a56496c
package com.glsx.smart.config; package com.glsx.smart.config;
import com.alibaba.fastjson.JSON;
import com.glsx.smart.pojo.pb.InstanceFence.Fence; import com.glsx.smart.pojo.pb.InstanceFence.Fence;
import com.glsx.smart.utils.GCJ2WGS; import com.glsx.smart.utils.GCJ2WGS;
import kafka.javaapi.producer.Producer; import kafka.javaapi.producer.Producer;
...@@ -53,7 +54,8 @@ public class DeviceAddressProducer { ...@@ -53,7 +54,8 @@ public class DeviceAddressProducer {
Fence.OptFamilyFenceInfo familyFenceInfo = this.buildFamilyFence(value, deviceFamilyInfo); Fence.OptFamilyFenceInfo familyFenceInfo = this.buildFamilyFence(value, deviceFamilyInfo);
try { try {
String topic = kafkaConfig.getDeviceTopic(); String topic = kafkaConfig.getDeviceTopic();
log.info("推送kafka topic【{}】的数据:{} {} {}", topic, deviceId, lngAndLat, value); log.info("推送kafka设备地址:{} {} {}", deviceId, lngAndLat, value);
log.info("推送kafka topic【{}】的数据:{} {} {}", topic, deviceId, JSON.toJSONString(hm), value);
KeyedMessage<byte[], byte[]> message = new KeyedMessage<>(topic, deviceId.getBytes(), familyFenceInfo.toByteArray()); KeyedMessage<byte[], byte[]> message = new KeyedMessage<>(topic, deviceId.getBytes(), familyFenceInfo.toByteArray());
producer.send(message); producer.send(message);
}catch (Exception e){ }catch (Exception e){
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!