Kaynağa Gözat

Small fixes

German Osin 4 yıl önce
ebeveyn
işleme
a4f1908fb6

+ 9 - 4
kafka-ui-api/src/main/java/com/provectus/kafka/ui/cluster/deserialization/SchemaRegistryRecordDeserializer.java

@@ -5,6 +5,7 @@ import lombok.extern.log4j.Log4j2;
 
 import java.io.IOException;
 import java.util.Collections;
+import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
 import java.util.concurrent.ConcurrentHashMap;
@@ -101,10 +102,14 @@ public class SchemaRegistryRecordDeserializer implements RecordDeserializer {
 
 	private Object parseAvroRecord(ConsumerRecord<Bytes, Bytes> record) throws IOException {
 		String topic = record.topic();
-		byte[] valueBytes = record.value().get();
-		GenericRecord avroRecord = (GenericRecord) avroDeserializer.deserialize(topic, valueBytes);
-		byte[] bytes = AvroSchemaUtils.toJson(avroRecord);
-		return parseJson(bytes);
+		if (record.value()!=null) {
+			byte[] valueBytes = record.value().get();
+			GenericRecord avroRecord = (GenericRecord) avroDeserializer.deserialize(topic, valueBytes);
+			byte[] bytes = AvroSchemaUtils.toJson(avroRecord);
+			return parseJson(bytes);
+		} else {
+			return new HashMap<String,Object>();
+		}
 	}
 
 	private Object parseJsonRecord(ConsumerRecord<Bytes, Bytes> record) throws IOException {

+ 10 - 0
kafka-ui-api/src/main/resources/application-bet.yml

@@ -0,0 +1,10 @@
+kafka:
+  clusters:
+    -
+      name: local
+      bootstrapServers: b-1.sandbox.kbqc5i.c3.kafka.eu-central-1.amazonaws.com:9092
+#      zookeeper: z-2.sandbox.kbqc5i.c3.kafka.eu-central-1.amazonaws.com:2181
+      schemaRegistry: http://localhost:8081
+  admin-client-timeout: 5000
+zookeeper:
+  connection-timeout: 1000

+ 5 - 3
kafka-ui-api/src/main/resources/application.yml

@@ -1,9 +1,11 @@
 kafka:
+  clusters:
+    - name: local
+      bootstrapServers: b-1.sandbox.kbqc5i.c3.kafka.eu-central-1.amazonaws.com:9092
+      zookeeper: z-2.sandbox.kbqc5i.c3.kafka.eu-central-1.amazonaws.com:2181
+      schemaRegistry: http://localhost:8081
   admin-client-timeout: 5000
 zookeeper:
   connection-timeout: 1000
-spring:
-  jmx:
-    enabled: true
 auth:
   enabled: false

+ 1 - 1
kafka-ui-react-app/.env

@@ -1,2 +1,2 @@
 # Kafka REST API
-REACT_APP_API_URL=http://localhost:8080/api
+REACT_APP_API_URL=/api