|
|
|
@ -61,7 +61,7 @@ public class KafkaController {
|
|
|
|
|
List<String> resultList = new ArrayList<>();
|
|
|
|
|
Consumer<String, String> consumer = new KafkaConsumer<>(kafkaUtil.getSafeConsumerPro(false));
|
|
|
|
|
consumer.subscribe(Collections.singletonList(topic));
|
|
|
|
|
ConsumerRecords<String, String> records = consumer.poll(5000);
|
|
|
|
|
ConsumerRecords<String, String> records = consumer.poll(100);
|
|
|
|
|
JSONArray jsonArray=new JSONArray();
|
|
|
|
|
for (ConsumerRecord<String, String> consumerRecord : records) {
|
|
|
|
|
String kfkContent = consumerRecord.value();
|
|
|
|
@ -176,7 +176,7 @@ public class KafkaController {
|
|
|
|
|
List<String> resultList = new ArrayList<>();
|
|
|
|
|
Consumer<String, String> consumer = new KafkaConsumer<>(kafkaUtil.getSafeConsumerPro(true));
|
|
|
|
|
consumer.subscribe(Collections.singletonList(topic));
|
|
|
|
|
ConsumerRecords<String, String> records = consumer.poll(5000);
|
|
|
|
|
ConsumerRecords<String, String> records = consumer.poll(100);
|
|
|
|
|
JSONArray jsonArray=new JSONArray();
|
|
|
|
|
for (ConsumerRecord<String, String> consumerRecord : records) {
|
|
|
|
|
String kfkContent = consumerRecord.value();
|
|
|
|
|