ref: 移除kafka的protobuf部分(目前尚不考虑使用) ref: collector部分配置项增加kafka的linger批量提交配置 todo: 数据收集部分改写为异步接口模式;优化大批量数据入库db时的性能main
parent
045f41cafe
commit
72aafb1c79
@ -1,6 +1,7 @@ |
||||
server: |
||||
port: 22019 |
||||
|
||||
servlet: |
||||
context-path: /api |
||||
spring: |
||||
profiles: |
||||
include: collector |
@ -1,18 +0,0 @@ |
||||
package rition.service.collector.mq; |
||||
|
||||
import com.google.protobuf.InvalidProtocolBufferException; |
||||
import org.apache.kafka.common.serialization.Deserializer; |
||||
import rition.common.data.dto.MetricDataProto; |
||||
|
||||
@Deprecated |
||||
public class CollectedMetricDataDeserializer implements Deserializer<MetricDataProto.CollectedMetricData> { |
||||
|
||||
@Override |
||||
public MetricDataProto.CollectedMetricData deserialize(String topic, byte[] data) { |
||||
try { |
||||
return MetricDataProto.CollectedMetricData.parseFrom(data); |
||||
} catch (InvalidProtocolBufferException e) { |
||||
throw new RuntimeException("exception happen while parsing protobuf data: ", e); |
||||
} |
||||
} |
||||
} |
@ -1,13 +0,0 @@ |
||||
package rition.service.collector.mq; |
||||
|
||||
import com.google.protobuf.GeneratedMessageV3; |
||||
import org.apache.kafka.common.serialization.Serializer; |
||||
|
||||
@Deprecated |
||||
public class ProtobufMessageSerializer implements Serializer<GeneratedMessageV3> { |
||||
|
||||
@Override |
||||
public byte[] serialize(String topic, GeneratedMessageV3 data) { |
||||
return data.toByteArray(); |
||||
} |
||||
} |
Loading…
Reference in new issue