main
周文涛 2 years ago
parent 9646e96bc5
commit e63be468d0

@ -65,6 +65,7 @@ public class KafkaController {
JSONArray jsonArray=new JSONArray(); JSONArray jsonArray=new JSONArray();
for (ConsumerRecord<String, String> consumerRecord : records) { for (ConsumerRecord<String, String> consumerRecord : records) {
String kfkContent = consumerRecord.value(); String kfkContent = consumerRecord.value();
System.out.println(kfkContent);
resultList.add(kfkContent); resultList.add(kfkContent);
if (!StringUtils.isEmpty(kfkContent)) { if (!StringUtils.isEmpty(kfkContent)) {
jsonArray.add(JSONObject.parseObject(kfkContent)); jsonArray.add(JSONObject.parseObject(kfkContent));

Loading…
Cancel
Save