Commit 33bfd3f1 authored by 张森's avatar 张森

kafka log 打印

parent d3952724
......@@ -74,9 +74,9 @@ public class KafkaConsumerService implements ApplicationRunner {
*/
@KafkaListener(id = "kafkaRoma", groupId = "kafkaRoma", topics = "#{'${queue.kafka.topics}'.split(',')}", containerFactory = "kafkaRomaContainerFactory")
public void kafkaListener(ConsumerRecord<?, String> record, Acknowledgment ack) {
log.info("kafka上报数据:{}", JSON.toJSONString(record));
try {
Optional<?> messages = Optional.ofNullable(record.value());
log.info("kafka上报数据:{}", record.toString());
if (messages.isPresent()) {
JSONObject object = JSONObject.fromObject(record.value());
com.alibaba.fastjson.JSONObject jsonObj = ClassToJsonUtil.class2json(object, commonMessage, record.topic());
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment