Kaynağa Gözat

kafak 获取数据 新增获取条数参数

andy 1 yıl önce
ebeveyn
işleme
5c9ab4ac45

+ 4 - 1
src/main/java/com/scbfkj/uni/process/Kafka.java

@@ -3,6 +3,7 @@ package com.scbfkj.uni.process;
 import com.fasterxml.jackson.core.JsonProcessingException;
 import com.scbfkj.uni.library.DataFormatUtil;
 import com.scbfkj.uni.library.UniReturnUtil;
+import com.scbfkj.uni.system.Config;
 import org.apache.commons.pool2.BaseKeyedPooledObjectFactory;
 import org.apache.commons.pool2.KeyedObjectPool;
 import org.apache.commons.pool2.PooledObject;
@@ -94,7 +95,9 @@ public class Kafka {
             }
             consumer.commitAsync();
 
-            System.out.println(DataFormatUtil.toString(messageList));
+            if (Config.isDebug()) {
+                System.out.println(DataFormatUtil.toString(messageList));
+            }
             return UniReturnUtil.success(messageList);
         } finally {
             consumerPool.returnObject(key, consumer);