Skip to content

Commit a4f1908

Browse files
committed
Small fixes
1 parent dce98a0 commit a4f1908

File tree

4 files changed

+25
-8
lines changed

4 files changed

+25
-8
lines changed

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

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55

66
import java.io.IOException;
77
import java.util.Collections;
8+
import java.util.HashMap;
89
import java.util.List;
910
import java.util.Map;
1011
import java.util.concurrent.ConcurrentHashMap;
@@ -101,10 +102,14 @@ private MessageFormat detectFormat(ConsumerRecord<Bytes, Bytes> record) {
101102

102103
private Object parseAvroRecord(ConsumerRecord<Bytes, Bytes> record) throws IOException {
103104
String topic = record.topic();
104-
byte[] valueBytes = record.value().get();
105-
GenericRecord avroRecord = (GenericRecord) avroDeserializer.deserialize(topic, valueBytes);
106-
byte[] bytes = AvroSchemaUtils.toJson(avroRecord);
107-
return parseJson(bytes);
105+
if (record.value()!=null) {
106+
byte[] valueBytes = record.value().get();
107+
GenericRecord avroRecord = (GenericRecord) avroDeserializer.deserialize(topic, valueBytes);
108+
byte[] bytes = AvroSchemaUtils.toJson(avroRecord);
109+
return parseJson(bytes);
110+
} else {
111+
return new HashMap<String,Object>();
112+
}
108113
}
109114

110115
private Object parseJsonRecord(ConsumerRecord<Bytes, Bytes> record) throws IOException {
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
kafka:
2+
clusters:
3+
-
4+
name: local
5+
bootstrapServers: b-1.sandbox.kbqc5i.c3.kafka.eu-central-1.amazonaws.com:9092
6+
# zookeeper: z-2.sandbox.kbqc5i.c3.kafka.eu-central-1.amazonaws.com:2181
7+
schemaRegistry: http://localhost:8081
8+
admin-client-timeout: 5000
9+
zookeeper:
10+
connection-timeout: 1000
Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
11
kafka:
2+
clusters:
3+
- name: local
4+
bootstrapServers: b-1.sandbox.kbqc5i.c3.kafka.eu-central-1.amazonaws.com:9092
5+
zookeeper: z-2.sandbox.kbqc5i.c3.kafka.eu-central-1.amazonaws.com:2181
6+
schemaRegistry: http://localhost:8081
27
admin-client-timeout: 5000
38
zookeeper:
49
connection-timeout: 1000
5-
spring:
6-
jmx:
7-
enabled: true
810
auth:
911
enabled: false

kafka-ui-react-app/.env

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
# Kafka REST API
2-
REACT_APP_API_URL=http://localhost:8080/api
2+
REACT_APP_API_URL=/api

0 commit comments

Comments
 (0)